H3LD3R

WHILE

May 22nd, 2013
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.52 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  5. <title>Ciclo While</title>
  6. <link href="css.css" rel="stylesheet" type="text/css" />
  7. </head>
  8.  
  9. <body>
  10. <div class="header">
  11.     <h1>TIS - JAVASCRIPT</h1>
  12. </div>
  13. <div class="wrapper">
  14. <div class="nav">
  15.     <a href="index.html"    class="buttons">HOME    </a>
  16.     <a href="codigo.html"   class="buttons">CODIGO  </a>
  17.     <a href="dowhile.html"  class="buttons">DOWHILE </a>
  18.     <a href="for.html"  class="buttons">FOR </a>
  19.     <a href="ifelse.html"   class="buttons">IFELSE  </a>
  20.     <a href="while.html"    class="buttons">WHILE   </a>
  21.     <a href="if.html"   class="buttons">IF  </a>
  22. </div>
  23.  
  24.  
  25.     <td class="tgrande">
  26.     <h1 align="center">Expressão While</h1>
  27.     <p align="center">Usa-se o while quando se quer que um trecho de código se repita X vezes, com condicional bem simples</p>
  28.     <script>
  29.     numero=6
  30.     while(numero>0)
  31.     {
  32.     numero--
  33.     alert(numero)
  34.     }
  35.     </script>
  36.     <hr>
  37.     <p>Enquanto a condição for verdadeira, o bloco será executado. Note que dentro do bloco estamos executando um código que fará a condição ser falsa depois de algumas repetições. se não fizéssemos a condição ficar falsa, ele entraria no que chamamos de loop infinito, o que não é nada bom.</td>
  38. </tr>
  39. <tr>
  40.     <td class="tpequeno">
  41.     <p align="center"><b>CURSO TÉCNICO DE INFORMÁTICA SISTEMAS</b></td>
  42. </tr>
  43.  
  44. </div>
  45. </body>
  46. </html>
Advertisement
Add Comment
Please, Sign In to add comment