Multiple choice

Which of the options shows the correct steps to process a file in C++ program?

  1. Name the file, open the file and close the file

  2. Open the existing file, read/write the file and close the file

  3. Open the file, read the file and write a file

  4. Create a file, open the file and close the file

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

The steps to process a file in C++  are

  1. Open the file
  2. Read or write the file
  3. Close the file