feat: add while loops, break and continue statements

This commit is contained in:
2026-04-21 23:53:41 +02:00
parent 68ec14e541
commit 92eefb5cf1
10 changed files with 397 additions and 9 deletions
+20
View File
@@ -0,0 +1,20 @@
fn main() -> i32 {
let i = 0;
let sum = 0;
while i < 10 {
i = i + 1;
if i % 2 == 0 {
continue;
}
if i > 7 {
break;
}
sum = sum + i;
}
return sum;
}