enfoire

3.

Apr 11th, 2020
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.75 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <title></title>
  5.     <meta charset="utf-8">
  6.     <script type="text/javascript">
  7.         //ператор управления while
  8.         console.log('цикл while');
  9.         //
  10.         /*
  11.         while(<условие>){
  12.            //потвторяющийся код
  13.         }
  14.         */
  15.        
  16.         /*let i = 0;
  17.         while(i<3){
  18.             console.log(i);
  19.             i = i + 1; // изменеям значение переменной i на 1
  20.                
  21.        }
  22.         console.log('цикл while завершен');*/
  23.  
  24.         // написать цикл while который будет
  25.         //выводить числа от 10 до -10 включительно
  26.  
  27.         let i = 10;
  28.         while(i>-11){
  29.             console.log(i);
  30.             i = i - 1;
  31.         }
  32.     </script>
  33. </head>
  34. <body>
  35.  
  36. </body>
  37. </html>
Advertisement
Add Comment
Please, Sign In to add comment