Ascending and Descending order

just wanna ask...
what function will I use so that the program will ascend or descend. I tried If but I need lesser code...
here is the part of the code.
1
2
3
x > y;
y = z;
z > y;

Also...I can't use array...just only if...else... sorry if I'm troubling you...
statements have no effect.

> what function will I use so that the program will ascend or descend.
I don't understand what you want. Please provide an example.
I meant, If I entered 3 numbers the program will put it in ascending order.
But I need lesser code...
Because the code I made is a lot longer...
so I just want to ask what function to use in order to have lesser code....
We could work on your code.

To sort number, you could use std::sort(), however you need them to be in a container (like an array).
Topic archived. No new replies allowed.