1
2
3
4
5
6
bool isprime(int a){
for(int i = 2; i * i <= a; i++)
if(a % i == 0)
return false;
return true;
}