Question 1: C++ File Stream Declaration
Which header file is required for file handling in C++?
Question 2: C++ File Modes
Which mode is used to append data at the end of a file in C++?
Question 3: C++ Guess the Output – Writing File
What will this program do?
Question 4: C++ File Reading
Which class is used to read from a file in C++?
Question 5: C++ Guess the Output – Reading File
Suppose "data.txt" contains 1234. What will this program print?
Question 6: C++ File Opening Multiple Modes
Which of the following opens a file for both reading and writing?
Question 7: C++ Guess the Output – Appending File
What will happen when this program runs?
Question 8: C++ Binary File Mode
Which flag is used to open a file in binary mode?
Question 9: C++ Guess the Output – getline from File
Suppose "note.txt" contains:
C++ is fun!
What will this program print?
Question 10: C++ Closing File
Why is file.close() used in C++?