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'.
1
Expert's answer
2011-10-11T08:01:03-0400
#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 the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS