MarcinKrol

Zad 9 - JS

Nov 24th, 2020 (edited)
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. const l1 = prompt('Podaj pierwszą liczbę(1/3)');
  2. const l2 = prompt('Podaj drugą liczbę(2/3)');
  3. const l3 = prompt('Podaj trzecią liczbę(3/3)');
  4.  
  5. //l1
  6. if (l1 <= l2 && l2 <= l3 ){
  7. document.write(`${l1} <= ${l2} <= ${l3} `);
  8. }
  9. else if (l1 <= l3 && l3 <= l2){
  10. document.write(`${l1} <= ${l3} <= ${l2} `);
  11. }
  12. // L2
  13. else if (l2 <= l1 && l1 <= l3){
  14. document.write(`${l2} <= ${l1} <= ${l3} `);
  15. }
  16. else if (l2 <= l3 && l3 <= l1){
  17. document.write(`${l2} <= ${l3} <= ${l1} `);
  18. }
  19. //l3
  20. else if (l3 <= l2 && l2 <= l1){
  21. document.write(`${l3} <= ${l2} <= ${l1} `);
  22. }
  23. else if(l3 <= l1 && l1 <= l2){
  24. document.write(`${l3} <= ${l1} <= ${l2} `);
  25. }
  26.  
  27. document.write('<br> <= - mniejsze lub równe');
Advertisement
Add Comment
Please, Sign In to add comment