From: Steven Baltakatei Sandoval Date: Fri, 12 Aug 2022 22:40:26 +0000 (+0000) Subject: update(src/kr):Complete exercise 1-7: print eof value X-Git-Url: https://zdv2.bktei.com/gitweb/BK-2023-05.git/commitdiff_plain/a57c60b156a355e45b44619518627fe280ebdce2?hp=2a8a7b5d4a72b64bd8178ef85b8213e198aea0c0 update(src/kr):Complete exercise 1-7: print eof value --- 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 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 index 0000000..6d8bf4d --- /dev/null +++ b/src/kr_exercises/ch1/s1.5/print_eof_value.c @@ -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 + +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 index 0000000..94c3e21 --- /dev/null +++ b/src/test6.c @@ -0,0 +1,25 @@ +/* Desc: + * Usage: ./test5 + * Ref/Attrib: [1] https://youtu.be/ix5jPkxsr7M?t=3072 + */ + +#include +#include + +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+ + */