-
What will be the output of the following C code?
#include <stdio.h>
int main()
{
FILE *fp;
char ch;
int num = 0;
fp = fopen("file1.txt", "r");
while (!feof(fp))
{
ch = getc(fp);
putc(ch, stdout);
}
}
-
- Prints to the screen content of file1.txt completely
- Prints to the screen some contents of newfile1.txt
- Compilation error
- Segmentation fault
- None of these
Correct Option: D
Segmentation fault