]> zdv2.bktei.com Git - BK-2023-05.git/commitdiff
update(src/kr):Complete exercise 1-7: print eof value
authorSteven Baltakatei Sandoval <baltakatei@gmail.com>
Fri, 12 Aug 2022 22:40:26 +0000 (22:40 +0000)
committerSteven Baltakatei Sandoval <baltakatei@gmail.com>
Fri, 12 Aug 2022 22:40:26 +0000 (22:40 +0000)
src/kr_exercises/ch1/s1.5/print_eof_value [new file with mode: 0755]
src/kr_exercises/ch1/s1.5/print_eof_value.c [new file with mode: 0644]
src/test6.c [new file with mode: 0644]

diff --git a/src/kr_exercises/ch1/s1.5/print_eof_value b/src/kr_exercises/ch1/s1.5/print_eof_value
new file mode 100755 (executable)
index 0000000..8710439
Binary files /dev/null and b/src/kr_exercises/ch1/s1.5/print_eof_value differ
diff --git a/src/kr_exercises/ch1/s1.5/print_eof_value.c b/src/kr_exercises/ch1/s1.5/print_eof_value.c
new file mode 100644 (file)
index 0000000..6d8bf4d
--- /dev/null
@@ -0,0 +1,19 @@
+/* Desc: Prints value of EOF
+ * Usage: name=print_eof_value; gcc -o "$name" "$name".c; ./"$name";
+ * Ref/Attrib: [0]: The C Programming Language, 2nd Edition, Section 1.5.1
+ */
+
+/* Exercise 1-7 Prints the value of EOF specified by stdio.h
+ */
+#include <stdio.h>
+
+int main(){
+  int output;
+  output = EOF;
+  printf("EOF value:%d", output);
+  return 0;
+};
+
+/* Author: Steven Baltakatei Sandoval
+ * License: GPLv3+
+ */
diff --git a/src/test6.c b/src/test6.c
new file mode 100644 (file)
index 0000000..94c3e21
--- /dev/null
@@ -0,0 +1,25 @@
+/* Desc:
+ * Usage: ./test5
+ * Ref/Attrib: [1] https://youtu.be/ix5jPkxsr7M?t=3072
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int main()
+{
+  char characterName[] = "Thomas";
+  int characterAge = 67;
+  printf("\n");
+  printf("There was once a man named %s\n", characterName);
+  printf("He was %i years old.\n", characterAge);
+  characterAge = 1;
+  printf("He really liked the name %s\n", characterName);
+  printf("but he did not like being %i.\n", characterAge);
+  return 0;
+};
+
+/*
+ * Author: Steven Baltakatei Sandoval
+ * License: GPLv3+
+ */