64 671
Assignments Done
99,2%
Successfully Done
In September 2018

Answer to Question #4838 in C++ for matt

Question #4838
write a program that ask the user to enter two numbers. the program should use the conditional operator to determine which number is the smaller and which is the larger.
Expert's answer

#include <iostream.h>
#include <conio.h>
main(){
int a,b;
cout<<"Enter number a:";
cin>>a;
cout<<"Enter number b:";
cin>>b;
if (a>b) cout<<"a is larger than b";
if (a<b) cout<<"b is larger than a";
if (a==b) cout<<"a is equal b";
getch();
}

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