publicstaticboolean isprime(int x) ...{ if (x <=7) ...{ if (x ==2|| x ==3|| x==5|| x ==7) returntrue; } int c =7; if (x %2==0) returnfalse; if (x %3==0) returnfalse; if (x %5==0) returnfalse; int end = (int) Math.sqrt(x); while (c <= end) ...{ if (x % c ==0) ...{ returnfalse; } c +=4; if (x % c ==0) ...{ returnfalse; } c +=2; if (x % c ==0) ...{ returnfalse; } c +=4; if (x % c ==0) ...{ returnfalse; } c +=2; if (x % c ==0) ...{ returnfalse; } c +=4; if (x % c ==0) ...{ returnfalse; } c +=6; if (x % c ==0) ...{ returnfalse; } c +=2; if (x % c ==0) ...{ returnfalse; } c +=6; } returntrue; }