Question: Answer in C++ Given numeric variables x, y, and z (initialized elsewhere in the program), create an if/else if/else sequence to produce the desired results.

Answer in C++

Given numeric variables x, y, and z (initialized elsewhere in the program), create an if/else if/else sequence to produce the desired results. ? If x is less than or equal to y, and y is less than or equal to z, print out "Ascending Order". ? If x is greater than or equal to y, and y is greater than or equal to z, print out "Descending Order". ? If x, y, and z are all equal, print out "All three numbers are equal" ? If x, y, and z are not ordered - print out "These number are not ordered!" Note, your sequence should print out only one? message about the entered numbers! For example, if the user enters 2, 2, 2, then your program should say: "All three numbers are equal". If the user enters 2, 2, 4, then you program should say: "Ascending Order", and if the user enters 4, 2, 2, the program should say: "Descending Order". #include using namespace std; int main() { int x, y, z; cout << "Please enter three integers: "; cin >> x >> y >> z; // YOUR CODE HERE

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!