Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main() {
- int x=0;
- int y=0;
- int z=0;
- cout<<"Give me 3 number , to arrange from less to more\n";
- cin>>x;
- cin>>y;
- cin>>z;
- cout<<"-- The numbers form less to more --\n";
- if(x<y && y<z) {
- cout<<x<<endl;
- cout<<y<<endl;
- cout<<z<<endl;
- }
- else if(x<y && z<y) {
- cout<<x<<endl;
- cout<<z<<endl;
- cout<<y<<endl;}
- else if(y<z && z<x) {
- cout<<y<<endl;
- cout<<z<<endl;
- cout<<x<<endl;
- }
- else if(y<z && x<z) {
- cout<<y<<endl;
- cout<<x<<endl;
- cout<<z<<endl;
- }
- else if(z<x && x<y){
- cout<<z<<endl;
- cout<<x<<endl;
- cout<<y<<endl;
- }
- else if(z<x && y<x){
- cout<<z<<endl;
- cout<<x<<endl;
- cout<<y<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement