Discussion :: Input / Output
-
Point out the error in the program?
#include
/* Assume there is a file called 'file.c' in c:\tc directory. */ int main() { FILE *fp; fp=fopen("c:\tc\file.c", "r"); if(!fp) printf("Unable to open file."); fclose(fp); return 0; }
A.
No error, No output. |
B.
Program crashes at run time. |
C.
Output: Unable to open file. |
D.
None of above |
Answer : Option C
Explanation :
The path of file name must be given as "c:\\tc\file.c"
Be The First To Comment