Skip to main content

File Handling In C Plus Plus — Part 2 MCQs with Explanations

Practice high-yield Programming & Software Development MCQs on File Handling In C Plus Plus — Part 2 with worked academic solutions for FPSC, PPSC, NTS, NITB, PTS.

Questions
16
Difficulty Level
Exam-Level
Target Exams
FPSC, PPSC, NTS...
Estimated Time
20 mins
Exam-Level FPSC PPSC NTS NITB PTS
Verified for Commission Syllabus • Oct 14, 2026
16

Verified Practice Questions

Interactive test mode with detailed academic worked solutions

Live Progress | 0/16 answered
✓ 0 correct ✗ 0 wrong 0% score
Question 1 of 16
★ FPSC ★ PPSC

Which function is used to read a line from a file in C++?

Question 2 of 16
★ FPSC ★ PPSC

By default, all the files in C++ are opened in . . . . . . . . mode.

Question 3 of 16
★ FPSC ★ PPSC

Which header file is required to use file I/O operations?

Question 4 of 16
★ FPSC ★ PPSC

Which function is used to reposition the file pointer?

Question 5 of 16
★ FPSC ★ PPSC

Which of the following is not used as a file opening mode?

Question 6 of 16
★ FPSC ★ PPSC

Which of the following is used to create an output stream?

Question 7 of 16
★ FPSC ★ PPSC

What is the use of ios::trunc mode?

Question 8 of 16
★ FPSC ★ PPSC

Which of the following is not used to seek file pointer?

Question 9 of 16
★ FPSC ★ PPSC

Which of the following is the default mode of the opening using the ifstream class?

Question 10 of 16
★ FPSC ★ PPSC

Which of the following is used to create a stream that performs both input and output operations?

Question 11 of 16
★ FPSC ★ PPSC

Which of the following is used to move the file pointer to start of a file?

Question 12 of 16
★ FPSC ★ PPSC

Which of the following statements are correct? 1. It is not possible to combine two or more file opening mode in open() method. 2. It is possible to combine two or more file opening mode in open() method. 3. ios::in and ios::out are input and output file opening mode respectively.

Question 13 of 16
★ FPSC ★ PPSC

What is the return type open() method?

Question 14 of 16
★ FPSC ★ PPSC

Which of the following is the default mode of the opening using the ofstream class?

Question 15 of 16
★ FPSC ★ PPSC

Which function is used in C++ to get the current position of file pointer in a file?

Question 16 of 16
★ FPSC ★ PPSC

Which of the following is the default mode of the opening using the fstream class?

✓ Link copied to clipboard
Continue Your Practice

Advance Html — Part 1

Master the next curriculum module with 40 exam-standard MCQs.

Next Practice Set →

💡 Examiner's Advisory for Programming & Software Development

In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.

More Modules in Programming & Software Development

View All →
📚

Study Guides

Topic summaries and syllabus breakdown

Explore Guides →
🎯

Complete Library

Search through 78,000+ verified MCQs

Browse Library →
📱

Mobile App

Offline mock tests and instant bookmarks

Get Mobile App →