Skip to content

Instantly share code, notes, and snippets.

@luchoching
Created December 17, 2016 15:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luchoching/f39538f9f38bc631ce5513c3927d8514 to your computer and use it in GitHub Desktop.
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
#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