Check Even or Odd in C++.
#include<iostream>
using namespace std;
int main()
{
int number;
cout<<"Enter a number ::";
cin>>number;
if(number%2==0)
{
cout<<"This is an even number \n";
}
else
{
cout<<"This is an odd number \n";
}
return 0;
}
OUTPUT
Enter a number :: 75
This is an Odd Number
No comments:
Post a Comment
Please do not any spam link in Comment Box