add factloop from course

This commit is contained in:
Mylloon 2022-12-15 19:39:41 +01:00
parent a08024d982
commit dc2122e5f8
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

12
tests/33_fact-loop.test Normal file
View file

@ -0,0 +1,12 @@
int factloop (int n) {
int r = 1;
while (n > 0) {
r = n * r;
n = n - 1;
}
return r;
}
void main () {
puti(factloop(10));
}