01Medium · ✦ AI-labelled practice
A Class XII program must read an existing text file without changing it for record set 1. Which choice should it use?
- r
- w
- a
- rb
Check answer and explanation +
A — rMode r opens an existing text file for reading without changing its contents.
Source: CBSE Computer Science (083) curriculum 2026–27 · original syllabus-aligned practice 02Easy · ✦ AI-labelled practice
A Class XII program must replace the contents of a text file for record set 2. Which choice should it use?
- r
- a
- rb
- w
Check answer and explanation +
D — wMode w opens a text file for writing and truncates existing content.
Source: CBSE Computer Science (083) curriculum 2026–27 · original syllabus-aligned practice 03Easy · ✦ AI-labelled practice
A Class XII program must add text at the end of an existing file for record set 3. Which choice should it use?
- r
- wb
- a
- w
Check answer and explanation +
C — aMode a appends new text at the end while retaining the existing contents.
Source: CBSE Computer Science (083) curriculum 2026–27 · original syllabus-aligned practice 04Easy · ✦ AI-labelled practice
A Class XII program must read a binary file containing pickled records for record set 4. Which choice should it use?
- a
- rb
- r
- wb
Check answer and explanation +
B — rbBinary data should be read using rb mode.
Source: CBSE Computer Science (083) curriculum 2026–27 · original syllabus-aligned practice 05Medium · ✦ AI-labelled practice
A Class XII program must write a new binary file containing pickled records for record set 5. Which choice should it use?
- wb
- w
- rb
- a
Check answer and explanation +
A — wbBinary data should be written using wb mode.
Source: CBSE Computer Science (083) curriculum 2026–27 · original syllabus-aligned practice