# include int main ( ) // // Notice that we can only pack at most 10 characters into LINE, // because there must always be room for a terminating NULL. // // Notice that, if the input line is SHORTER than 10 characters, // we get a short line. // // If the line is LONGER than 10 characters, we get the first 10 // characters, and the next call to FGETS gets the next 10 characters... // { int i; char line[11]; i = 0; while ( fgets ( line, 11, stdin ) != NULL ) { i = i + 1; printf ( "%s", line ); } printf ( "\n" ); printf ( "A total of %i 'chunks' were read.\n", i ); return 0; }