From 5018e06c580dd21c958ec1672c26a3448faf0c55 Mon Sep 17 00:00:00 2001 From: zlg Date: Wed, 13 Feb 2013 20:48:44 -0600 Subject: Add license file, reorganize project --- ch1/1-06_eof-test.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 ch1/1-06_eof-test.c (limited to 'ch1/1-06_eof-test.c') diff --git a/ch1/1-06_eof-test.c b/ch1/1-06_eof-test.c new file mode 100644 index 0000000..5214338 --- /dev/null +++ b/ch1/1-06_eof-test.c @@ -0,0 +1,15 @@ +#include + +/* The C Programming Language, 2nd Edition + * + * Exercise 1-6: Verify that the expression 'getchar() != EOF' is 0 or 1. + * + * Answer: Easy. + */ + +int main(void) { + int c; + c = (getchar() != EOF); + printf("%d\n", c); + return 0; +} -- cgit v1.2.3-54-g00ecf 2fb414d22dd3e55801c85b02c1af7'/> Category-0 solutions to The C Programming Language, 2nd Editionzlg
aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-08-22AUTHORS: update contact infozlg1-1/+1
2017-05-20perfeeerrrrrmzlg1-1/+1
2017-05-208-1: Correct superfluous increment, commentzlg1-2/+1