C++ Programming Code Examples C++ > If Else and Switch Case Code Examples Check the number is an Even or Odd Check the number is an Even or Odd Following C++ program ask to the user to enter a number, to check and display whether the entered number is an even number or an odd number: - The number is an even number, only if, it is divisible by 2 - The number is an odd number, only if, it is not divisible by 2 /* C++ Program - Check Even or Odd */ #include<iostream.h> #include<conio.h> void main() { clrscr(); int num; cout<<"Enter a number :"; cin>>num; if(num%2==0) { cout<<"This is an even number"; } else { cout<<"This is an odd number"; } getch(); }