summaryrefslogtreecommitdiff
path: root/Homework/cs5300/compiler/p5-compiler/data/test12.c
diff options
context:
space:
mode:
authorElizabeth Alexander Hunt <me@liz.coffee>2026-07-02 11:55:17 -0700
committerElizabeth Alexander Hunt <me@liz.coffee>2026-07-02 11:55:17 -0700
commit6bf4b90c90f15f4ab60833bddf5b5756d1a6b1f6 (patch)
treeed97e39ec77c5231ffd2c394493e68d00ddac5a4 /Homework/cs5300/compiler/p5-compiler/data/test12.c
downloadmisc-undergrad-main.tar.gz
misc-undergrad-main.zip
Diffstat (limited to 'Homework/cs5300/compiler/p5-compiler/data/test12.c')
-rw-r--r--Homework/cs5300/compiler/p5-compiler/data/test12.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/Homework/cs5300/compiler/p5-compiler/data/test12.c b/Homework/cs5300/compiler/p5-compiler/data/test12.c
new file mode 100644
index 0000000..4bb7f58
--- /dev/null
+++ b/Homework/cs5300/compiler/p5-compiler/data/test12.c
@@ -0,0 +1,15 @@
+int fib(int i) {
+ if (i == 0) return 1;
+ if (i == 1) return 1;
+ return fib(i-1) + fib(i-2);
+}
+
+void main() {
+ int i;
+ i = 0;
+ println("This program prints the first 12 numbers of the Fibonacci sequence.");
+ while (i < 12) {
+ println(fib(i));
+ i = i + 1;
+ }
+}