Program to Check Odd or Even in C++

 Here is a simple C++ program to check whether a number is odd or even:



✅ Program: Check Odd or Even in C++

#include <iostream>

using namespace std;

int main()

{
int num;
// Input number
cout << "Enter a number: ";
cin >> num;
// Check odd or even
if (num % 2 == 0) {
cout << num << " is Even." << endl;

else 

{
cout << num << " is Odd." << endl;
}
return 0;
}


Previous Post Next Post

Contact Form