aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsinanmohd <sinan@firemail.cc>2023-05-11 12:26:37 +0530
committersinanmohd <sinan@firemail.cc>2023-05-11 12:26:37 +0530
commitc2e62961609da793219749028e0477adc980451a (patch)
tree407038ecacd5ddf3fcef3e95646ee87e5f96383b
parentbfe41ee41ad751c558a4483cfdf6317ac3a3d506 (diff)
7.1: initial commit
-rw-r--r--7.1/Makefile8
-rw-r--r--7.1/main.c17
2 files changed, 25 insertions, 0 deletions
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 <stdio.h>
+#include <string.h>
+#include <ctype.h>
+
+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;
+}