Saturday 15 March 2014

C Program Display contents of a file on screen.

/* Display contents of a file on screen. */
# include "stdio.h"
main( )
{
FILE  *fp ;
char  ch ;
fp = fopen ( "PR1.C", "r" ) ;
while ( 1 )
{
ch = fgetc ( fp ) ;
if ( ch == EOF )
break ;
printf ( "%c", ch ) ;
}
fclose ( fp ) ;
}

No comments:

Post a Comment