-
What will be the output of the following C code?
#include <stdio.h>
#include <string.h>
int main()
{
char line[25];
FILE *fp;
fp = fopen("file.txt", "r");
while (fgets(line, 25, fp))
fputs(line, stdout);
return 0;
}
-
- No.of lines present in file.txt
- Infinite loop
- Compilation error
- Segmentation fault
- None of these
Correct Option: D
Segmentation fault