package Logical;
// Print prime Number in between 1 to 100
public class PrimeNumberSeries {
public static void main(String[] args) {
System.out.println("Print Prime Number Between 1 to 100");
int c=0;
for(int i=1;i<=100;i++) {
c=0;
for(int j=2;j<=i/2;j++) {
if(i%j==0)
c++;
}
if(c==0 && i!=1)
System.out.print(i+", ");
}
}
}
Comments
Post a Comment