Created
December 17, 2016 15:25
-
-
Save luchoching/f39538f9f38bc631ce5513c3927d8514 to your computer and use it in GitHub Desktop.
(My solution) 1.6: Write a program to print the value of EOF : http://stackoverflow.com/questions/1782080/what-is-eof-in-the-c-programming-language
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
int value; | |
int value2; | |
value = getchar(); | |
value2 = value != EOF; | |
while (value2) | |
{ | |
value = getchar(); | |
value2 = value != EOF; | |
} | |
printf("%d - at EOF\n", value); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment