Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <title>Ciclo While</title>
- <link href="css.css" rel="stylesheet" type="text/css" />
- </head>
- <body>
- <div class="header">
- <h1>TIS - JAVASCRIPT</h1>
- </div>
- <div class="wrapper">
- <div class="nav">
- <a href="index.html" class="buttons">HOME </a>
- <a href="codigo.html" class="buttons">CODIGO </a>
- <a href="dowhile.html" class="buttons">DOWHILE </a>
- <a href="for.html" class="buttons">FOR </a>
- <a href="ifelse.html" class="buttons">IFELSE </a>
- <a href="while.html" class="buttons">WHILE </a>
- <a href="if.html" class="buttons">IF </a>
- </div>
- <td class="tgrande">
- <h1 align="center">Expressão While</h1>
- <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>
- <script>
- numero=6
- while(numero>0)
- {
- numero--
- alert(numero)
- }
- </script>
- <hr>
- <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>
- </tr>
- <tr>
- <td class="tpequeno">
- <p align="center"><b>CURSO TÉCNICO DE INFORMÁTICA SISTEMAS</b></td>
- </tr>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment