Multiple choice

Which one of the following is valid for opening a read-only ASCII file?

  1. fileOpen (filenm, "r")

  2. fileOpen (filenm, "ra")

  3. fileOpen (filenm, "read")

  4. fopen (filenm, "read")

  5. fopen (filenm, "r")

Reveal answer Fill a bubble to check yourself
E Correct answer
Explanation

In C, the standard library function to open a file is fopen. The mode 'r' is used to open a file for reading in text mode.