Advertisement
ahmad_zizo

isPrime

Feb 17th, 2015
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. int isprime(int number){
  2. int i;
  3. for(i=3; i<=sqrt(number); i=i+2)
  4. if(number%i == 0)return 0;
  5. if(number < 2 || (number > 3 && number%2 == 0)) return 0;
  6. return 1;
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement