Answer to Question #297102 in C++ for junior

Question #297102

Write a program that reads an integer and determines and prints whether it is odd or even. [Hint: Use the remainder operator. An even number is a multiple of two. Any multiple of two leaves a remainder of zero when divided by 2.].


1
Expert's answer
2022-02-12T14:39:00-0500
#include <iostream>
using namespace std;




int main(){
	int number;
	cout<<"Ente the number : ";
	cin>>number;
	if(number%2==0){
		cout<<"The numbe is even\n";
	}else{
		cout<<"The numbe is odd\n";
	}
	system("pause");
	return 0;
}

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