java program to find prime number between 1 and 100

Solutions on MaxInterview for java program to find prime number between 1 and 100 by the best coders in the world

showing results for - "java program to find prime number between 1 and 100"
Ivan
30 Jun 2016
1class PrimeNumbers
2{
3   public static void main (String[] args)
4   {		
5       int i =0;
6       int num =0;
7       //Empty String
8       String  primeNumbers = "";
9
10       for (i = 1; i <= 100; i++)         
11       { 		  	  
12          int counter=0; 	  
13          for(num =i; num>=1; num--)
14	  {
15             if(i%num==0)
16	     {
17 		counter = counter + 1;
18	     }
19	  }
20	  if (counter ==2)
21	  {
22	     //Appended the Prime number to the String
23	     primeNumbers = primeNumbers + i + " ";
24	  }	
25       }	
26       System.out.println("Prime numbers from 1 to 100 are :");
27       System.out.println(primeNumbers);
28   }
29}
queries leading to this page
print all the prime numbers from 0 to 1000 in javaprime numbers upto given number in javaprint all prime numbers upto 100 in javawrite a java program to find prime no between 1 to 1000java all prime numberprogram to find prime numbers java between a to bhow to find prime numbers from 1 to 100 in javaprint all prime numbers from 1 to n javacreate a program that displays 5 digit prime numbers in javaprime numbers till 100 codingformula to find prime numbers between 1 and 100 javaprime number in java from 1 to 10020 write a java program to print prime number from 2 to n get all prime numbers from 1 10000 and add to string in javahow to find out prime numbers in java from 1 to 100 to print all prime numbers between 1 to 100 in javaall prime numbers between 1 to 100 in java while loopprint prime numbers upto n in javaall the prime number till 100 javato print all the prime numbers between 1 to 100 in javafind prime numbers between 0 to 100 javafind prime numbers from 1 to 100 in javaprime number 1 to 50 program in java java list of prime numbershow to get the first 50 prime numbers in java using do loopprime numbers between 1 and 100 in javaprint all prime numbers from x to 1 in javaprint all prime numbers from 2 to n javajava program to find prime number between 1 and 100print 11 prime number per line write logic to print prime numbers between 1 to 100 2ajava program to print prime numbers from 2 to nfind prime numbers till 1000 javaprime numbers between 1 to 50 using thread code with expaination in javacreate a program that displays prime numbers from 1 to 100 prime number program in java print 1 to 20list of prime numbers from 1 to 100 in javaprime numbers java 1 to 100prime number between 1 100000 loop javahow to find all prime nos from 100 to 200 in javaprint prime numbers list javawrite a program to find prime number in a given range in javajava calculate prime number 1 1000000 5d1 to 1000 prime numbers program in javawrite a program to print prime numbers between 10 and 99 prime no between 1 to 100 in javaprime number from 1 to n in javaprime numbers between 1 to 100 in javajava program to display prime numbers from 1 to 100java program to print prime numbers between 1 and 100java print all prime numbersprime numbers between 1 to 10 in javaprint prime numbers from 1 to 100 using java with explanationwrite java code to find prime number between 1 to 100prime number 1 to 50 in javajava code to generate prime numbertotal number of prime numbers between 1 to 1500000 java using single loop1 to 100 prime numbers javaprime numbers between 2 to 100 in javahow to find prime numbers from 1 to 100 in java using switchprime numbers 1 to 100 in java23 29 java program to find the prime numbers between 1 to 100 print prime number program in javajava code to find prime numbers between m and nprime number till 10 5e12 javajava code for prime number from 1 to 100get all prime numbers from 1 10000 in javahow many prime numbers between 1 and 100 in javadisplay all prime number and non prime number in javatotal number of prime numbers between 1 to 100 java programprime numbers between 1 to 100 javaget prime numbers and put into string in javaa prime number is a whole number greater than 1 that is divisible by 1 and itself only write a program that determines the first 50 prime numbers in javajava program to count prime numbers between 1 and 10000prime number upto 100 in javaprint prime numbers from 1 to 100 in java with explanationfind the prime numbers from 1 to 100 in javajava program to print all prime numbers between 1 to 100list of prime numbers 1 100 program logicjava program to find sum of prime numbers between 1 and 100java program to print prime numbers in a given rangehow to print prime numbers in javajava program to loop for first 100000 positive prime numbersprime or not 0 to 100 javaprime number 1 to 100 in javaprimes between 1 and 100 in javaprime numbers from 1 to 100 java code efficientlyhow to find prime numbers between start and end javafind prime numbers between start and end javajava find prime numbers 1 100prime numbers from 1 to 50 javaprint all prime numbers from 100 to 1 in javatotal number of prime numbers between 1 to 100 javaprime numbers 1 100 javaprime number program in java up to 100prime number program 1 100 in javaprime number from 1 to 50 in javaprint list of prime numbers in javaprint prime number javaprime numbers in 100 javafind all prime numbers javajava program to print prime numbers between 10 and 99prime number program in java between 1 to 100prime number and 1 program in javajava prime number counter1 to 100 prime numbers java programprime number betwwen 1 to hundred javaprime number between 1 to 100 in javawrite a program to generate prime number from 1 to 100 in javacheck prime numbers 1 100 javaprime numbers from 1 to 100 javajava program get 50 prime numbersprime number from 1 to 100 javajava program to print prime numbers upto njava program to count prime numbers between 1 and 100java prime numbers from 1 to 100prime numbers from 1 to 100 in javaprime numbers program in java between 1 to 100 sumgenerate prime numbers in javaprime number program from 1 to 50 in javajava program to display prime numbers from 2 to 100return all prime numbers from 1 to 100how to calculate all the prime numbers in a for loop in javaprint prime numbers from 1 to 100 in javajava program to display prime numbers between 1 to nprime numbers 1 to 50 program in javaprint prime numbers in javaget prime number till 10 5e5 jav ajava program to find prime number between 1 and 100