Even or odd in C++ by R4R Team

What is Even number?
The number which is divisible by 2 is known as Even number like 2,4,6,...

What is Odd number?
The number which is not divisible by 2 is known as Odd number like 1,3,5,...

program:

#include< iostream>
using namespace std;
int main()
{
int n;
cout<<"Enter any number to check even or odd"<< endl;
cin>>n;
if(n%2==0)
cout<<"Number is Even";
else
cout<<"Number is Odd";
return 0;
}


output-

Enter any number to check even or odd
23
Number is odd

Enter any number to check even or odd
12
Number is Even




Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!