SHARE
TWEET

Untitled

a guest Jun 19th, 2017 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
Want to get better at C++?
Learn to code C++ in 2017
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top