Print Prime Numbers Below 100 - Java Program
public class PrintAllPrimeNumbersBelow100 {
public static void main (String args[]) {
int i;
for(int num=2; num < 100; num++) {
int midValue=(num + 1 )/2;
for(i=midValue; i>=2; i--){
if((num % i) ==0 ) {
break;
}
}
if(i==1) {
System.out.print(""+ num + " ");
}
}
}
}