Answer to Question #233986 in C++ for Brie

Question #233986
Write a program in which the main() method calls a method named evenOdd().The evenOdd() method takes one integers argument, and then display the sentence "The number is ODD " if The argument is an odd integer or "The number is EVEN" if the argument is even.
1
Expert's answer
2021-09-06T13:16:59-0400
#include <iostream>


using namespace std;




void evenOdd(int number){
	if(number%2==0){
		cout<<"The number is EVEN\n";
	}else{
		cout<<"The number is ODD\n";
	}
}
int main(){
	int number;
	cout<<"Enter the number: ";
	cin>>number;
	evenOdd(number);
	cin>>number;
	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
APPROVED BY CLIENTS