Below I have shared the C++ program to check a number is odd or even.

For example if user enters an odd number like 5 then the output will be Odd number and if user enters even number like 8 then output will be Even number.

If you have any problem regarding below odd or even number program then you can ask it by commenting below.

## C++ Program to Check Number is Odd or Even

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
#include<iostream> using namespace std; int main() { int a; cout<<"enter the number:"; cin>>a; if(a%2==0) cout<<"\nEven number"; else cout<<"\nOdd number"; return 0; } |

**Output**

enter the number:7

Even number

“if(a%2==0)”……what does it mean?

It checks if a number is completely divisible by 2 then it is an even number else odd number.