int Isprim(int num) { if(num<=2) return 0; for(int j=2,j<sqrt(num);j++) { if(num%j==0) return 0; } return 1; }