A

Admin • 833K Points
Coach

Q. Choose a correct statement about C file operation program?

Code:
int main()
{
FILE *fp;
char ch;
fp=fopen("readme.txt","r");
while((ch=fgetc(fp)) != EOF)
{
printf("%c",ch);
}
}
  • (A) FOPEN opens a file named readme.txt in Read Mode ("r).
  • (B) EOF is End Of File. ch==EOF checks for end of file and while loop stops or exits.
  • (C) FGETC(fp) is a function that returns one character and cursor goes to next character.
  • (D) All the above
  • Correct Answer - Option(D)
  • Views: 26
  • 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.