Commit 6e9bd3db authored by Karine's avatar Karine

Exercise_06_21, Version2

parent cbfc8580
#include <iostream>
bool
IsEven(int x)
isEven(int x)
{
return x % 2 == 0;
}
......@@ -19,11 +19,11 @@ main()
std::cout << "Enter a number to check: ";
std::cin >> number;
bool result = IsEven(number);
if (result == true) {
bool result = isEven(number);
if (result) {
std::cout << number << "is even." << std::endl;
} else {
std::cout << number <<"is odd." << std::endl;
std::cout << number << "is odd." << std::endl;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment