public class PE7 { public static void main(String[] args) { int count = 0; int num = 0; while(count<=10001) { num++; if(isPrime(num)==true) { count++; } } System.out.println(num); } public static boolean isPrime(long num){ boolean isPrimeFlag = true; int i = 2; while(i<Math.sqrt(num)) { if(num%i==0) { isPrimeFlag = false; break; } i++; } return isPrimeFlag; } }

----jGRASP exec: java PE7 104009 ----jGRASP: operation complete.