Answer:
Following is the program in C++ program
#include<iostream> // header file
using namespace std; // namespace
int main() // main function
{
int num1 = 0; // variable declaration
char test;// variable declaration
do
{
cout << " Enter the number: ";
cin >> num1; //Read the input by the user
if (num1 % 2 == 0) // check the condition of even
cout << " number is even.\n";
else // check the condition of odd
cout << "Number is odd.\n";
cout << " Do you wanted the another test of number (y/n)? ";
cin >> test; //Read the input by user
} while (test == 'y' || test == 'Y'); //terating the loop
return 0;
}
Output:
Enter the number:45
number is even.
Do you wanted the another test of number (y/n) Y
Enter the number:5
Number is odd.
Do you wanted the another test of number (y/n) n
Explanation:
Following are the description of program