Here is a simple C++ program to check whether a number is odd or even:
✅ Program: Check Odd or Even in C++
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;
}
Tags:
Cplus