Multiple choice

How to check whether a file stream f1 was successfully opened or not?

  1. if(f1.open()) { .......... }

  2. if(f1.isopen) { ........... }

  3. if(f1.is_open()) { ............. }

  4. If(f1.is_open) { ................ }

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

The correct format to check whether a file stream f1 was successfully opened or not is as follows: if(f1.is_open()) { .................. }