int input;
cout < "enter="" input="" "=""><>
cin >> input;
int i = input / 2;
int d;
for (i >= 2; i--;) {
d = input % i;
if (d == 2 || i == 1)
cout < "not="" prime"=""><>
else
cout < "prime"=""><>
}
This code outputs prime numbers as both "prime" and "not prime" but I just want it to say "prime".
Please help me with this problem using c++.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here