Vidyalelo
C Programming · Q138

File Input Output

Programming · C Programming · question 138

Q138

What will be the output of the following C code? #include int main() FILE *fp; char c; int n = 0; fp = fopen("newfile1.txt", "r"); while (!feof(fp)) c = getc(fp); putc(c, stdout);

A.
Compilation error
B.
Prints to the screen content of newfile1.txt completely
C.
Prints to the screen some contents of newfile1.txt
D.
None of the mentioned
Answer

Answer: Option D

Solution

Answer: Option D
No explanation is given for this question Let's Discuss on Board