R

Ram Sharma • 193.86K 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

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.


Question analytics