Friday, 16 September 2016

To check whether the no is even or odd



#include < iostream.h >

void main()
{
int n;

cout<<"Enter an integer\n";
cin>>n;
if ( n%2 == 0 )
cout<<"Even\n";
else
cout<<"Odd\n";

Getch ();

}

No comments:

Post a Comment