From 6bf4b90c90f15f4ab60833bddf5b5756d1a6b1f6 Mon Sep 17 00:00:00 2001 From: Elizabeth Alexander Hunt Date: Thu, 2 Jul 2026 11:55:17 -0700 Subject: Init --- Homework/cs5300/compiler/p5-compiler/data/test12.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Homework/cs5300/compiler/p5-compiler/data/test12.c (limited to 'Homework/cs5300/compiler/p5-compiler/data/test12.c') 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; + } +} -- cgit v1.3