A

Admin • 828.03K Points
Coach

Q. Choose a correct statement about FGETS in C program

Code:
int main()
{
FILE *fp;
char str[80];
fp=fopen("readme.txt","r");
while(fgets(str,80,fp) != NULL)
{
printf("%s",str);
}
fclose(fp);
}
  • (A) str in fgets() is a like a user buffer that can store 80 characters each time
  • (B) FGETS returns null if no characters are left
  • (C) fgets() reads content from File. FPUS writes content back to File.
  • (D) All the above
  • Correct Answer - Option(D)
  • Views: 13
  • Filed under category C Programming
  • Hashtags:

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.