// determines whether a given number is prime or not #include using std::cin; using std::cout; using std::endl; int main() { int num; cout << " Give me an integer "; cin >> num; bool primo = true; int indice = 2; while ( indice <= num/2) { if(num%indice == 0) { primo = false; break; } indice++; } if(primo) cout << " Number " << num << " is prime " << endl; else cout << " Number " << num << " is not prime " << endl; return 0; }