add while loop calculation of a fibonacci number

This commit is contained in:
Neemek 2024-10-09 15:54:51 +02:00
parent a4a66a3041
commit 0473050229
Signed by: neemek
GPG key ID: 28360A8951CD0E9B

17
examples/fib.ang Normal file
View file

@ -0,0 +1,17 @@
# calculate fibonacci numbers with a loop
x := 0
n := 1
p := 1
while x < 100 {
f := n + p
p = n
n = f
write(f)
x = x + 1
}