write a c++ program that tells you if a number is odd or even
#include<iostream>
using namespace std;
int main()
{
int x,y;
cout<<"Enter first interger: ";
cin>>x;
if(x%2==0)
{
cout<<" The number "<<x<<" is even";
}
else
{
cout<<" The number "<<x<<" is odd";
}
}
Comments
Leave a comment