Jump to: navigation, search

The C Programming Language, 2nd Edition, by Kernighan and Ritchie
Exercise 1.07 on page 17

Write a program to print the value of EOF .



Warning: the answers on these pages are crowdsourced, open to anybody to provide/edit after free sign-up, have not all been vetted, might not be correct, let alone optimal, and should not be assumed to be.

Solution by Richard Heathfield

#include <stdio.h>

int main(void)
{
  printf("The value of EOF is %d\n\n", EOF);
  
  return 0;
}


Personal tools