diff options
| author | Elizabeth Alexander Hunt <me@liz.coffee> | 2026-07-02 11:55:17 -0700 |
|---|---|---|
| committer | Elizabeth Alexander Hunt <me@liz.coffee> | 2026-07-02 11:55:17 -0700 |
| commit | 6bf4b90c90f15f4ab60833bddf5b5756d1a6b1f6 (patch) | |
| tree | ed97e39ec77c5231ffd2c394493e68d00ddac5a4 /Homework/cs5300/compiler/p5-compiler/data/test13.c | |
| download | misc-undergrad-6bf4b90c90f15f4ab60833bddf5b5756d1a6b1f6.tar.gz misc-undergrad-6bf4b90c90f15f4ab60833bddf5b5756d1a6b1f6.zip | |
Diffstat (limited to 'Homework/cs5300/compiler/p5-compiler/data/test13.c')
| -rw-r--r-- | Homework/cs5300/compiler/p5-compiler/data/test13.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Homework/cs5300/compiler/p5-compiler/data/test13.c b/Homework/cs5300/compiler/p5-compiler/data/test13.c new file mode 100644 index 0000000..c1a5c72 --- /dev/null +++ b/Homework/cs5300/compiler/p5-compiler/data/test13.c @@ -0,0 +1,23 @@ +void main() { + int a[10]; + int i; + + println("This should print 0, 2, 2, 3, 6 and 36"); + a[0] = 0; + println(a[0]); + a[2] = 2; + println(a[2]); + + i = 2; + a[i] = i; + println(a[i]); + + i = 0; + while (i < 10) { + a[i] = i; + i = i + 1; + } + println(a[3]); + println(a[6]); + println(a[6]*6); +} |
