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
πŸ’¬ Discuss
βœ… Correct Answer: (D) All the above

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
194
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
83%
Success Rate