Write a program in c++ to input a number and check for odd or even
#include <iostream>
using namespace std;
int main()
{
int num;
cout << "Enter A Number To check for EVEN or ODD : ";
cin >> num;
if (num % 2 == 0)
cout << num << " is even";
else
cout << num << " is odd";
return 0;
}
OUTPUT
Enter A Number To check for EVEN or ODD : 56
56 is even
0 Comments:
Post a Comment