Advertisement
Guest User

Untitled

a guest
Jun 19th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <iostream>
  3. #include <stdlib.h>
  4. #include <math.h>
  5.  
  6. using namespace std;
  7. bool isprime(int long num){
  8.     if(num<=1)return false;
  9.         if(num==2)return true;
  10.     if(num%2==0)return false;
  11.     for(int long i=3;i<sqrt(num);i+=2){
  12.         if(num%i==0)return false;
  13.     }
  14.     return true;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement