Answer to Question #264890 in C++ for Rille

Question #264890

15. 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.


Ex, No. 1: 5 No. 1: 3


No. 2: 3 No. 2: 2


Sum is : 8 One of the number entered is not ODD



1
Expert's answer
2021-11-12T07:16:37-0500
#include<iostream>
using namespace std;
int main(){
	cout<<"Enter the first number:\n";
	int first;
	cin>>first;
	cout<<"Enter the second number:\n";
	int second;
	cin>>second;
	if(first%2 != 0 && second %2 != 0){
		cout<<"The addition of the two numbers are : "<<first + second<<endl;
	}
	else{
		cout<<"All are not odd\n";
	}
}

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