Last active
October 6, 2017 23:42
-
-
Save lrlucena/1c7739e5a2de9f6e65c01dca7824df72 to your computer and use it in GitHub Desktop.
Enquanto
This file contains hidden or 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
# soma vários números | |
var x := leia_inteiro | |
var soma := 0 | |
enquanto x >= 0 faça | |
soma := soma + x | |
x := leia_inteiro | |
fim | |
escreva soma |
This file contains hidden or 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
escreva "Digite a 1a nota entre 0.0 e 10.0" | |
var n1 := leia_real | |
enquanto n1 < 0.0 ou n1 > 10.0 faça | |
escreva "nota invalida, digite outro valor" | |
n1 := leia_real | |
fim | |
escreva "Digite a 2a nota entre 0.0 e 10.0" | |
var n2 := leia_real | |
enquanto n2 < 0.0 ou n2 > 10.0 faça | |
escreva "nota invalida, digite outro valor" | |
n2 := leia_real | |
fim | |
media = (n1 * 2 + n2 * 3) / 5.0 | |
escreva "média = {media}" |
This file contains hidden or 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
para i de 1 até 10 faça | |
escreva i | |
fim | |
var i := 1 | |
var stop := falso | |
enquanto i <= 10 e não stop faça | |
escreva i | |
i := i + 1 | |
se i > 5 então | |
stop := verdadeiro | |
fim | |
fim |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment