Question #237029

write a c++ program that tells you if a number is odd or even


Expert's answer

#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";
	}	
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS