Answer to Question #268532 in C++ for fiona

Question #268532

Make a program that will input two number, If the two number entered are ODD then perform the addition and display the Sum. Your program will be terminated by an option if the user not to proceed another entry.


1
Expert's answer
2021-11-19T10:02:01-0500
#include<iostream>
using namespace std;
int main(){
	cout<<"Enter the first number: ";
	int firstNumber;
	cin>>firstNumber;
	cout<<"Enter the second number: ";
	int secondNumber;
	cin>>secondNumber;
	if(firstNumber%2 == 0 || secondNumber %2 == 0){
		cout<<"Numbers are not odd.\n";
	}
	else{
		cout<<"\nSum = "<<(firstNumber + secondNumber)<<endl;
	}
	cin>>firstNumber;
	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