60 414
Assignments Done
98,2%
Successfully Done
In April 2018

Answer to Question #4504 in C++ for Scott

Question #4504
How do I write a program prompting the user for two inputs, where the inputs must be added together along with branching code to determine whether or not the answer is above 50. Below 50 will indicate that the number is 'too low' and above 50 will indicate that the number is 'too high'.
Expert's answer
#include <iostream>
using namespace std;
main(){
int a,b,c;
cout<<"Please, enter a number:"\r\n;
cin>>a;
cout<<"Please, enter one more number:"\r\n;
cin>>b;
c = a+b;
if (c<50) cout<<"too low"<<\r\n;
if (c>50) cout<<"too high"<<\r\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 first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions