How can I ask if a number is even/odd and positive/negative at the same time?
I've already done the program that asks if a number is positive or negative, but I have no idea how to add (input % 2 == 0) into it.
Thank you.
What I have tried:
int main()
{
int input;
cout << "Please enter a number\n";
cout << ":";
cin >> input;
if (input > 0) {
cout << input << " is a positive number" << endl;
}
else if (input == 0)
{
cout << input << " is neither positive nor negative number " << endl;
}
else
{
cout << input << " is a negative number " << endl;
}
return 0;
}