Ask your own question, for FREE!
Computer Science 11 Online
OpenStudy (anonymous):

how to make a prime number checking using c++?

OpenStudy (arnavguddu):

int isprime(int n) { for(int i=2; i<n; i++) { if(n%i == 0) return 0; } return 1; } if the return value is 1 the number-n is prime.....otherwise not

OpenStudy (rsmith6559):

for( i = 3; ( i * i ) < n; i += 2 ) will speed that up.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!