Answer to Question #237029 in C++ for c++

Question #237029

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


1
Expert's answer
2021-09-15T17:26:01-0400
#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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS