Advertisement
AlexandrP

Homework, 5

Dec 10th, 2022
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let a = 3245;
  2. let b = 994;
  3. let c = 1239234;
  4.  
  5. let max = 0;
  6. let min = 0;
  7. let mid = 0;
  8.  
  9. if (a > b) {
  10.   min = b;
  11.   max = a;
  12.  
  13.   if (b > c) {
  14.     min = c;
  15.     mid = b;
  16.     max = a;
  17.   } else if (b < c) {
  18.     if (c > a) {
  19.       max = c;
  20.       min = b;
  21.       mid = a;
  22.     } else if (c < a) {
  23.       max = a;
  24.       min = b;
  25.       mid = c;
  26.     }
  27.   }
  28.  
  29.   console.log(max, mid, min);
  30. }
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement