Now, I will translate it into C++ program. If you experience this phase, you will know that the computer programing is juat like kind of language the function of which is just like the logic thinking.
The outputs:
Please enter a whole number: 45
The number you've entered is odd.
Thanks. Bye.
The corresponding codes:
//input an integer and test whether it even or odd numbers
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int number = 0;
cout << "Please enter a whole number: ";
cin >> number;
if (number % 2 == 0){
cout << "The number you've inputed is even." << endl;
}else{
cout << "The number you've entered is odd." << endl;
}
cout << "Thanks. Bye.";
return 0;
}