Table Of Contents
Previous Section Next Section

Program 72: No End in Sight

This simple program is to copy the standard input to the standard output. It's one of the first I/O-related programs that a student writes.

  1 /************************************************
  2  * copy -- Copy stdin to stdout.                *
  3  ************************************************/
  4 #include <stdio.h>
  5
  6 int main()
  7 {
  8     // Character to copy
  9     char ch;
 10
 11     while ((ch = getchar()) != EOF)
 12     {
 13         putchar(ch);
 14     }
 15     return (0);
 16 }

(Next Hint 15. Answer 63.)

Table Of Contents
Previous Section Next Section