Answer to Question #23736 in C++ for EMMANUEL

Question #23736
write a program which inputs three numbers and outputs the message SORTED if the numbers are in ascending order, and output NOT SORTED if otherwise.
1
Expert's answer
2013-02-05T09:12:37-0500
#include <conio.h>
#include <iostream>

using namespace std;

void main()
{
int a, b, c;
cout << "Input 3 numbers: ";
cin >> a >> b >> c;

if (c > b && b > a)
cout << "SORTED" << endl;
else
cout << "NOT SORTED" << endl;
_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 the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS