Important Questions

C++ Program to check whether the number is even or odd

//C++ Program to check whether the number is even or odd
//header files
#include<iostream.h>
#include<conio.h>

void main()
{

clrscr();
int n;
cout<<"Enter an integer:";
cin>>n;
if(n%2==0)
{

cout<<n<<" is even";

}
else
{

cout<<n<<" is odd";

}

getch();

}
//Now run the program by ctrl+f9

Output


You can also see a video how to run this program