1
0
mirror of https://github.com/krislamo/knrc.git synced 2025-09-11 16:39:28 +00:00

Exercise 1-6 and 1-7. expression = 1, and EOF = -1

This commit is contained in:
2021-11-05 21:17:39 -04:00
parent 7099cc732e
commit 979467565f

View File

@@ -1,10 +1,12 @@
#include <stdio.h>
/* copy input to output; 2nd version */
/* Exercise 1-6 and 1-7 */
int main()
{
int c;
while ((c = getchar()) != EOF)
putchar(c);
printf("EOF = %d\n", EOF);
while (c = getchar() != EOF)
printf("c = %d\n", c);
}