diff --git a/tests/33_fact-loop.test b/tests/33_fact-loop.test new file mode 100644 index 0000000..78d096e --- /dev/null +++ b/tests/33_fact-loop.test @@ -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)); +}