Horje
how to check if a number is prime c++ Code Example
how to check if a number is prime c++
bool isPrime(int number){

    if(number < 2) return false;
    if(number == 2) return true;
    if(number % 2 == 0) return false;
    for(int i=3; (i*i)<=number; i+=2){
        if(number % i == 0 ) return false;
    }
    return true;

}




Cpp

Related
how to write hello world in c++ Code Example how to write hello world in c++ Code Example
C++ array sort method Code Example C++ array sort method Code Example
cin.getline Code Example cin.getline Code Example
c++ threads Code Example c++ threads Code Example
conditional operator in c++ Code Example conditional operator in c++ Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8