NEB Class 12 • Computer Science • Programming II • Practice Set
File Handling in C Practice Set: NEB 12 Computer
Master File Handling in C through clear concepts, representations, a reliable answer method and exam-focused practice.

Concepts · Worked reasoning · NEB practice
Quick answer: C file handling uses streams and the FILE interface to open, read, write, seek and close persistent data. Programs must choose text or binary mode, check every operation and preserve record boundaries deliberately.
Worked practice
Build the result from meaning, not memory
C file handling uses streams and the FILE interface to open, read, write, seek and close persistent data. Programs must choose text or binary mode, check every operation and preserve record boundaries deliberately.
Worked example
FILE *f=fopen(“marks.txt”,”r”); if(!f) handles failure before fgets reads a bounded line and fclose releases the stream.
The governing relationship is fopen returns a stream or NULL; use formatted, line, byte or block I/O appropriately, test errors/EOF correctly and fclose resources on every completed path. Check the convention, geometry or boundary condition before calculation.
Independent practice ladder
- Define the key physical quantities and give their SI units.
- Draw and label the relevant wave, ray, mode or energy diagram.
- Recalculate the worked example after changing one input by a factor of two.
- Explain the result without equations.
- Create a Nepal-relevant situation such as a classroom speaker, musical pipe, optical slit or thermal machine.
- Compare two cases and predict the larger output before calculating.
- Find and repair one deliberately wrong sign, node or unit.
- Write a three-mark answer and a five-mark answer.
Answer protocol: diagram → known data → principle → symbolic equation → SI substitution → result → physical check. Using feof before a failed read, ignoring fopen errors, mixing incompatible text/binary assumptions, writing raw structs as portable files, or forgetting fclose.
NEB answer method
Model → evidence → equation → check
First identify the system and what the question asks. Label the diagram, apparatus or reaction with SI quantities, then state the principle before selecting an equation. Solve symbolically where possible and check units, limiting cases and chemical or physical meaning.
| Stage | Question | Evidence |
|---|---|---|
| Model | What is idealised? | Assumption stated |
| Representation | Which diagram fits? | Labels or balanced equation |
| Calculation | Which relation follows? | Symbols then SI values |
| Evaluation | Does it make sense? | Unit, sign and trend check |
Make the idea concrete in Nepal
Connect the model to a school laboratory, household technology, health, environment, energy or local material. The example should clarify the science rather than merely mention a place. Compare a prediction with an observation and record uncertainty.
Review the NEB Class 12 Computer Science revision roadmap and the complete Computer Science guide. For online or physical tuition, call 9846662070.
Questions students ask about File Handling in C
What is the central idea of File Handling in C?
C file handling uses streams and the FILE interface to open, read, write, seek and close persistent data. Programs must choose text or binary mode, check every operation and preserve record boundaries deliberately.
Which equation should I remember?
fopen returns a stream or NULL; use formatted, line, byte or block I/O appropriately, test errors/EOF correctly and fclose resources on every completed path.
How should I begin a numerical?
Draw the situation, list known quantities in SI units, choose the governing relation symbolically, substitute once and finish with a unit and reasonableness check.
What is a common exam mistake?
Using feof before a failed read, ignoring fopen errors, mixing incompatible text/binary assumptions, writing raw structs as portable files, or forgetting fclose.
How can I practise this topic?
Alternate one concept explanation, one diagram and two numericals. Revisit errors after a day instead of only rereading the solution.
Where can I get tuition support?
For online or physical KTM Tuition classes, call 9846662070. After Grade 12, the MKS Education panel below gives preparation and pre-counselling contacts.
Frequently asked questions
References and next steps
Scope checked against CDC Nepal; concept support from an institutional reference and OpenStax Science. Continue with the File Handling in C cluster.
NEB +2 tuition support
Ask about online or physical tuition
For focused Class 11 and Class 12 subject tuition, lesson clarification, worked-example practice and exam preparation, call 9846662070. Class mode, timetable, teacher availability and fees should be confirmed directly before enrolment.
Continue planning
Related Study Guides
File Handling in C Study Guide: NEB 12 Computer
Object-oriented Programming Concepts & Features: NEB Class 12 Computer Guide
File Handling in C: NEB Class 12 Computer Guide
Object-oriented Programming Concepts & Features Study Guide: NEB 12 Computer
Pointers in C Practice Set: NEB 12 Computer
Object-oriented Programming Concepts & Features Practice Set: NEB 12 Computer
Artificial Intelligence & Machine Learning Study Guide: NEB 12 Computer
Classes, Objects, Encapsulation, Inheritance & Polymorphism: NEB Class 12 Computer Guide
Artificial Intelligence & Machine Learning: NEB Class 12 Computer Guide
Classes, Objects, Encapsulation, Inheritance & Polymorphism Study Guide: NEB 12 Computer
Cloud Computing & Virtualization Study Guide: NEB 12 Computer
Classes, Objects, Encapsulation, Inheritance & Polymorphism Practice Set: NEB 12 Computer
