While Statement¶
While statements allows repeating a set of code until the condition goes falsey. break
and continue
statement can be used inside a loop.
Syntax
while (condition) {
statement
}
Example
i := 0;
while (i < 5) {
print i;
i = i + 1;
}
# 0 1 2 3 4