Skip to content

Commit

Permalink
Outros exemplos
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagoboeing committed Jul 2, 2019
1 parent 21a92ca commit 4448fdf
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,50 @@ end
`-- exemplo de comentário de linha`

`#| exemplo de comentário de bloco |#`

## Loops

### whileTrueDo

```
main begin
int: valor.
read(valor).
(valor < 0) whileTrueDo
read(valor).
end.
(valor == 0) whileFalseDo
write(valor, \n).
valor -= 1.
end.
end
```

## if

```
main begin
float: valor.
read(valor).
(valor > 0.0) ifTrueDo
write("maior").
ifFalseDo
write("menor ou igual").
end.
end
```

```
main begin
int: lado, area.
read(lado).
area = 0.
(lado > 0) ifTrueDo
area = lado * lado.
end.
write(area).
end
```

0 comments on commit 4448fdf

Please sign in to comment.