fastest way to check if a number is prime c++ code example
Example: check prime cpp gfg
bool isPrime(int s){
if(s<=1)return false;
if(s==2)return true;
int m = ceil(sqrt(s));
for(int i=2;i<=m;i++){
if(s%i==0){
return false;
}
}
return true;
}