/*WAP to Display contents of a file on screen*/
#include<stdio.h>
#include<conio.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 ) ;
getch();
}



No comments:
Post a Comment