C Programming :: File Input/Output - Discussion
Home > C Programming > File Input/Output > MCQs Questions Discussion
1 / 12
What is the output of the following 'C' program ?
#include <stdio.h>
void main()
{
FILE *ptr;
char i;
ptr=fopen("abc","r");
while((i=fgets(ptr))!=EOF)
printf("%c",i);
}
#include <stdio.h>
void main()
{
FILE *ptr;
char i;
ptr=fopen("abc","r");
while((i=fgets(ptr))!=EOF)
printf("%c",i);
}
Acontents of abc followed by an infinite loop
BCompilation Error
CContents of abc
DNone of these
Answer: Option (Login/Signup)
Show Explanation
Asked In ::
No Discussion on this question yet!