Write a c++ program to find out the given number is odd or even

Write a c++ program to find out the given number is odd or even. This program will print the odd or even number in result. By using this program we can check the number is odd or even using the c++ programming language for beginners.

#include <iostream>
using namespace std;
int main()
{
int n;
cout << "Enter the number";
cin >> n;
if ( n % 2 == 0)
cout << n << " is even";
else
cout << n << " is odd";
return 0;
}

Output:

Enter the number 45                                                                                                                                              

45 is odd