From c2e62961609da793219749028e0477adc980451a Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Thu, 11 May 2023 12:26:37 +0530 Subject: 7.1: initial commit --- 7.1/Makefile | 8 ++++++++ 7.1/main.c | 17 +++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 7.1/Makefile create mode 100644 7.1/main.c diff --git a/7.1/Makefile b/7.1/Makefile new file mode 100644 index 0000000..ae5b7bd --- /dev/null +++ b/7.1/Makefile @@ -0,0 +1,8 @@ +lower upper : + gcc -o lower main.c + cp lower upper + +.PHONY : clean +clean: + rm lower upper + diff --git a/7.1/main.c b/7.1/main.c new file mode 100644 index 0000000..f210c39 --- /dev/null +++ b/7.1/main.c @@ -0,0 +1,17 @@ +#include +#include +#include + +int main(int argc, char *argv[]) +{ + char c; + + if (!strcmp(argv[0], "lower")) + while ((c = getchar()) != EOF) + putchar(tolower(c)); + else + while ((c = getchar()) != EOF) + putchar(toupper(c)); + + return 0; +} -- cgit v1.2.3