From 726566bb23ca1de4fe877f593bf67e1f45653f28 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Tue, 16 Apr 2024 20:46:08 -0400 Subject: [PATCH] Up through lcthw ex9 --- lcthw/.gitignore | 1 + lcthw/Makefile | 2 +- lcthw/ex9.c | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 lcthw/ex9.c diff --git a/lcthw/.gitignore b/lcthw/.gitignore index 805e668..f2ef6fa 100644 --- a/lcthw/.gitignore +++ b/lcthw/.gitignore @@ -2,3 +2,4 @@ ex1 ex3 ex7 ex8 +ex9 diff --git a/lcthw/Makefile b/lcthw/Makefile index 2628572..00d8825 100644 --- a/lcthw/Makefile +++ b/lcthw/Makefile @@ -1,6 +1,6 @@ CFLAGS ?= -Wall -g GDBRUN = gdb --batch --ex run --ex bt --ex q --args -BUILD_TARGETS = ex1 ex3 ex7 ex8 +BUILD_TARGETS = ex1 ex3 ex7 ex8 ex9 .PHONY: all all: build test diff --git a/lcthw/ex9.c b/lcthw/ex9.c new file mode 100644 index 0000000..d76067e --- /dev/null +++ b/lcthw/ex9.c @@ -0,0 +1,15 @@ +#include + +int main(int argc, char *argv[]) +{ + int i = 0; + while (i < 25) { + printf("%d", i); + i++; + } + + // need this to add a final newline + printf("\n"); + + return 0; +}