-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6a3eb77
commit a2aac37
Showing
4 changed files
with
48 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Estruturas de Controle | ||
Laços de repetições | ||
while | do while | ||
|
||
while (condição) { | ||
//condição verdadeira | ||
} | ||
|
||
do { | ||
//sempre executa o código 1 vez independente da condição | ||
//depois analisa a condição(semelhante a estrutura while) | ||
} while (condição) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* Exemplo de uso da estrutura while | ||
*/ | ||
|
||
let valor = 7 | ||
let i = 1 | ||
while (i < 11) { | ||
console.log(`${valor} x ${i} = ${i * valor}`) | ||
i++ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* Estudo das estruturas de controle | ||
* while | do while | ||
*/ | ||
|
||
const read = require('readline-sync') | ||
|
||
let x = 1; | ||
let y = 1; | ||
|
||
while (x < 11) { | ||
console.log("teste da estrutura while") | ||
x++ | ||
} | ||
|
||
read.question("Pressione a tecla [ENTER] para continuar") | ||
|
||
do { | ||
console.log("teste da estrutura do-while") | ||
y++ | ||
} while (y < 11) |