the following code which just displays file contents compiles successfully but give runtime error!!
Code:#include <stdio.h> int main() { FILE *fp; int c ; fp = fopen( "hp.txt","r" ); c = getc( fp ) ; while ( c != EOF ) { putchar( c ); c = getc ( fp ); } fclose( fp ); return 0; }