Guest User

Untitled

a guest
Jul 20th, 2021
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //https://zero.p2p.shpp.me/tasks/3_6_biggest_number.html
  2. let max = 0;
  3. while (true) { //
  4.     let num = +prompt("Яке число? "); // запит числа
  5.     if (num == 0) { // перевіряємо чи дорівнює нулю
  6.         break;
  7.     }
  8.     if ((num % 2) == 0) { // перевірка,чи парне число
  9.         if (max < num) {
  10.             max = num;
  11.         }
  12.     }
  13. }
  14. console.log("The max is " + max);
Advertisement
Add Comment
Please, Sign In to add comment