Advertisement
Guest User

Untitled

a guest
Apr 21st, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.  
  6. int x=0;
  7. int y=0;
  8. int z=0;
  9.  
  10. cout<<"Give me 3 number , to arrange from less to more\n";
  11. cin>>x;
  12. cin>>y;
  13. cin>>z;
  14. cout<<"-- The numbers form less to more --\n";
  15.  
  16. if(x<y && y<z) {
  17.  
  18. cout<<x<<endl;
  19. cout<<y<<endl;
  20. cout<<z<<endl;
  21. }
  22. else if(x<y && z<y) {
  23.  
  24. cout<<x<<endl;
  25. cout<<z<<endl;
  26. cout<<y<<endl;}
  27. else if(y<z && z<x) {
  28.  
  29. cout<<y<<endl;
  30. cout<<z<<endl;
  31. cout<<x<<endl;
  32. }
  33. else if(y<z && x<z) {
  34.  
  35. cout<<y<<endl;
  36. cout<<x<<endl;
  37. cout<<z<<endl;
  38. }
  39. else if(z<x && x<y){
  40.  
  41. cout<<z<<endl;
  42. cout<<x<<endl;
  43. cout<<y<<endl;
  44. }
  45. else if(z<x && y<x){
  46.  
  47. cout<<z<<endl;
  48. cout<<x<<endl;
  49. cout<<y<<endl;
  50. }
  51.  
  52.  
  53. return 0;
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement