Skip to content
NEB • Grade XII • Past Paper
NEB Grade XII Computer Science 2083 (2026) — Complete Question Paper Analysis, Solutions & Preparation Guide
← Back

Introduction

Computer Science at the NEB Grade XII level has evolved considerably over the past few years, and the 2083 (2026) paper (Sub. Code 4281’C’) reflects just how broad the subject has become — a single 50-mark, 2-hour exam now expects students to be comfortable with database design and SQL, JavaScript and PHP scripting, C programming with functions and structures, object-oriented programming concepts, networking hardware, software engineering models, and even emerging topics like cloud computing and the Internet of Things. For students used to thinking of “Computer Science” as primarily a programming subject, this paper is a useful reminder that NEB now tests a genuinely full-stack view of the field, from low-level C code all the way up to system design concepts like feasibility analysis and software development models.

What makes this paper worth working through carefully is how directly applied nearly every question is. There’s very little pure theory-recall here — even Group A’s MCQs ask students to trace through actual PHP code and predict its output, or to identify which SQL statement correctly filters and displays specific columns rather than just defining what SQL is. Group B carries this further with genuine programming tasks: writing a JavaScript program to find the smallest of three numbers, writing a PHP script that connects to a MySQL database and displays results in an HTML table, and comparing database models with concrete advantages rather than abstract definitions. Group C’s long-answer questions are almost entirely programming-based, asking students to write complete, working C programs using user-defined functions, loops, and arrays of structures — skills that require actual coding practice, not just conceptual familiarity.

This heavy applied-skills orientation means that success on this paper depends less on memorizing definitions and more on having actually written and tested code repeatedly — tracing through PHP or C snippets by hand, practicing SQL queries against sample tables, and building small JavaScript and C programs from scratch until the syntax becomes automatic. This article walks through every question with a clear explanation or complete working solution, breaks the paper down by chapter and topic, estimates weightage, and offers a preparation strategy built specifically around this paper’s strong programming and applied-skills focus.

Full Question Paper

Quick Answer Key (Group A — Multiple Choice Questions)

Q.NoAnswerConcept Tested
1C. TuplesDatabase terminology
2DSQL SELECT with WHERE and OR
3D. Open System InterconnectionNetworking — OSI model
4A. document.write()JavaScript — HTML output
5B. 1PHP — modulus operator
6B. Increments then returns valueC programming — pre-increment operator
7C. PolymorphismOOP concepts
8B. WaterfallSoftware development models
9C. IoT (Internet of Things)Emerging technology
🎯
Get NN Premium Subscription

Unlock all courses, entrance mock sets, PDF notes & more — just Rs. 250.

Get Premium →

Brief explanation of each MCQ:

  1. In relational database terminology, individual records (rows) in a table are formally called tuples, while columns are called fields (or attributes).
  2. The correct query must select only the specific columns requested (name and address, not all columns with *), and must correctly repeat the column name in each condition of the OR clause (address = "Kathmandu" or address = "Bhaktapur" rather than the shorthand address = "Kathmandu" or "Bhaktapur", which is invalid SQL syntax) — making option D the only fully correct statement.
  3. OSI stands for Open System Interconnection, the conceptual seven-layer model used to standardize how different networking systems communicate.
  4. document.write() is the JavaScript method used to write content directly into the HTML document output, unlike console.log(), which writes to the browser’s developer console rather than the page itself.
  5. The % operator in PHP is the modulus operator, returning the remainder of division. 10 % 5 = 0… wait, let’s check: since [latex]10 \div 5 = 2[/latex] exactly with no remainder, the correct output should actually be 0, not 1. Double-check this against your official answer key — option A (0) appears to be the mathematically correct result of $a % $b when $a=10 and $b=5, since 5 divides evenly into 10.
  6. ++X (pre-increment) increments the value of X first, and then returns the newly incremented value for use in the surrounding expression — distinct from X++ (post-increment), which returns the original value first and increments afterward.
  7. Polymorphism is the OOP feature that allows the same method name to behave differently depending on the number or type of parameters passed to it (method overloading) or the object calling it (method overriding).
  8. The Waterfall model follows a strict, linear, sequential progression through phases (requirements → design → implementation → testing → deployment), with each phase completed before the next begins, unlike more flexible/iterative models like Agile, Prototype, or Scrum.
  9. A device that adjusts room temperature automatically using real-time sensor data and internet connectivity is a classic example of IoT (Internet of Things), where everyday physical devices are connected to the internet to collect and act on data autonomously.

A note on Question 5: Based on standard PHP arithmetic, $a = 10; $b = 5; echo $a % $b; should output 0, since 10 divided by 5 leaves no remainder. The listed correct answer in many circulating answer keys is marked as B (1), which would actually be incorrect based on straightforward calculation — this is worth flagging for your students and double-checking against the official NEB answer key, since it’s possible the values in the original paper differ slightly from what was captured in this transcription, or there may be a genuine error in the circulated key.

Brief Solutions to Group B & C Questions

Q10: The hierarchical database model organizes data in a tree-like, parent-child structure where each child record has exactly one parent, while the relational database model organizes data into independent tables (relations) connected through common key fields, allowing more flexible querying across multiple relationships. Two advantages of the hierarchical model: it offers fast data retrieval when the access pattern matches the tree structure, and it enforces referential integrity naturally through its rigid parent-child links. Two advantages of the relational model: it offers much greater flexibility for complex queries involving multiple tables (via SQL joins), and it minimizes data redundancy through proper normalization across separate related tables.

Q10 OR: Second Normal Form (2NF) requires that a table first be in 1NF (all attributes atomic, no repeating groups) and additionally that all non-key attributes be fully functionally dependent on the entire primary key, not just part of it — this rule specifically matters for tables with composite (multi-column) primary keys. For example, consider a table with a composite key (StudentID, CourseID) that also stores StudentName and CourseName: StudentName depends only on StudentID (not the full composite key) and CourseName depends only on CourseID, so this table violates 2NF due to partial dependency. To convert it to 2NF, split it into three tables: a Students table (StudentID, StudentName), a Courses table (CourseID, CourseName), and an Enrollment table (StudentID, CourseID) capturing just the relationship — eliminating the partial dependencies.

Q11:

javascript

let a = parseFloat(prompt("Enter first number:"));
let b = parseFloat(prompt("Enter second number:"));
let c = parseFloat(prompt("Enter third number:"));

let smallest = a;
if (b < smallest) {
  smallest = b;
}
if (c < smallest) {
  smallest = c;
}

document.write("The smallest number is: " + smallest);

This program takes three numeric inputs, initializes smallest to the first number, then compares it against the second and third numbers in turn, updating smallest whenever a smaller value is found, and finally displays the result.

Q11 OR:

php

<?php
$conn = mysqli_connect("localhost", "root", "", "school");

if (!$conn) {
    die("Connection failed: " . mysqli_connect_error());
}

$sql = "SELECT * FROM student";
$result = mysqli_query($conn, $sql);

echo "<table border='1'>";
echo "<tr><th>Roll No</th><th>Name</th><th>Section</th><th>Marks</th></tr>";

while ($row = mysqli_fetch_assoc($result)) {
    echo "<tr>";
    echo "<td>" . $row['roll_no'] . "</td>";
    echo "<td>" . $row['name'] . "</td>";
    echo "<td>" . $row['section'] . "</td>";
    echo "<td>" . $row['marks'] . "</td>";
    echo "</tr>";
}

echo "</table>";
mysqli_close($conn);
?>

This script connects to the “school” database using mysqli_connect(), runs a SELECT * query on the student table, and loops through each returned row with mysqli_fetch_assoc() to print it as a row in an HTML table. (Column names like roll_no, name, section, and marks should be adjusted to match the actual table structure specified by the examiner or textbook convention.)

Q12: Object Oriented Programming (OOP) is a programming paradigm that organizes software design around objects — self-contained units that bundle together data (attributes) and the functions (methods) that operate on that data — rather than around a sequence of procedural steps. Four key features of OOP:

  1. Encapsulation — bundling data and methods together within a class and restricting direct access to internal data, exposing only what’s necessary through public methods, which protects data integrity.
  2. Inheritance — allowing a new class (subclass/derived class) to acquire the properties and behaviors of an existing class (superclass/base class), promoting code reuse and establishing hierarchical relationships between classes.
  3. Polymorphism — allowing the same method name or interface to take different forms depending on the object or parameters involved, such as through method overloading or overriding.
  4. Abstraction — hiding complex implementation details from the user and exposing only the essential features needed to interact with an object, simplifying how the system is used.

Q13: Technical feasibility assesses whether a proposed system can actually be built and implemented using currently available technology, tools, hardware, and technical expertise — essentially asking “can we build this?” given the organization’s technical resources and constraints. Economic feasibility assesses whether the projected benefits of the system (cost savings, revenue generation, efficiency gains) justify the total costs of developing and maintaining it — essentially asking “is this worth building?” from a cost-benefit standpoint, often evaluated using metrics like return on investment or payback period.

Q14: Cloud computing is the delivery of computing services — including storage, processing power, databases, and software — over the internet (“the cloud”) on an on-demand basis, rather than relying on local servers or personal devices to host and run everything. Three advantages: (1) Cost savings — organizations avoid the large upfront capital expenditure of purchasing and maintaining physical hardware, paying instead for only the resources they actually use; (2) Scalability — cloud resources can be scaled up or down quickly to match changing demand, without needing to purchase and install new physical infrastructure; (3) Accessibility — data and applications hosted in the cloud can be accessed from any location with an internet connection, enabling remote work and collaboration across different devices.

Q15: Twisted pair cable consists of pairs of insulated copper wires twisted together to reduce electromagnetic interference between them; it’s inexpensive and widely used for telephone lines and local area networks (Ethernet), though it has relatively limited bandwidth and is more susceptible to interference than other cable types over longer distances. Coaxial cable consists of a central copper conductor surrounded by an insulating layer, a metallic shield, and an outer insulating jacket; it offers better bandwidth and noise resistance than twisted pair cable and is commonly used for cable television and older network installations, though it’s bulkier and more expensive to install. Optical fibre cable transmits data as pulses of light through thin strands of glass or plastic fibre; it offers the highest bandwidth, longest transmission distances, and complete immunity to electromagnetic interference among the three cable types, making it ideal for high-speed backbone networks and long-distance communication, though it is the most expensive and requires more specialized equipment to install and maintain. (A diagram showing the cross-sectional structure of each cable type — twisted pairs, the concentric layers of coaxial cable, and the core-cladding structure of optical fibre — should accompany this answer for full marks.)

Q16a:

c

#include <stdio.h>

void checkNumber(int num) {
    if (num > 0) {
        printf("The number is positive.\n");
    } else if (num < 0) {
        printf("The number is negative.\n");
    } else {
        printf("The number is zero.\n");
    }
}

int main() {
    int n;
    printf("Enter a number: ");
    scanf("%d", &n);
    checkNumber(n);
    return 0;
}

Q16b:

c

#include <stdio.h>

void fibonacci(int first, int second, int terms) {
    int next;
    printf("%d %d ", first, second);
    for (int i = 3; i <= terms; i++) {
        next = first + second;
        printf("%d ", next);
        first = second;
        second = next;
    }
}

int main() {
    fibonacci(7, 14, 10);
    return 0;
}

This generates a Fibonacci-style series starting with the given first two terms (7 and 14 instead of the usual 0 and 1), where each subsequent term is the sum of the previous two, continuing up to 10 total terms.

Q16 OR:

c

#include <stdio.h>

struct Student {
    int rollNo;
    char name[50];
    char section[10];
    float marks;
};

int main() {
    struct Student students[10];
    int i;

    for (i = 0; i < 10; i++) {
        printf("Enter details for student %d:\n", i + 1);
        printf("Roll No: ");
        scanf("%d", &students[i].rollNo);
        printf("Name: ");
        scanf("%s", students[i].name);
        printf("Section: ");
        scanf("%s", students[i].section);
        printf("Marks: ");
        scanf("%f", &students[i].marks);
    }

    printf("\n--- Student Records ---\n");
    for (i = 0; i < 10; i++) {
        printf("Roll No: %d, Name: %s, Section: %s, Marks: %.2f\n",
               students[i].rollNo, students[i].name,
               students[i].section, students[i].marks);
    }

    return 0;
}

This program defines a Student structure holding roll number, name, section, and marks, creates an array of 10 such structures, reads data for each student in a loop, and then displays all the collected records in a second loop.

Exam Overview

  • Examination: NEB Grade XII Board Examination 2083 (2026)
  • Subject Code: 4281’C’
  • Full Marks: 50
  • Time: 2 hours
  • Structure: Group A (9 MCQs, 1 mark each), Group B (5 short-answer questions, 5 marks each, several with “OR” alternatives), Group C (2 long-answer questions, 8 marks each, one with an “OR” alternative)

Question Pattern Analysis

Group A is unusually applied for an objective section — rather than testing pure definitions, it asks students to trace through actual PHP code, evaluate correct SQL syntax against incorrect variants, and distinguish between the exact behavior of pre-increment versus post-increment operators in C, meaning surface familiarity with terminology isn’t enough to score well here. Group B mixes conceptual short-answer questions (feasibility analysis, cloud computing, OOP features) with hands-on coding tasks (JavaScript and PHP), giving students a genuine choice between more theoretical and more code-heavy alternatives via the “OR” options. Group C is almost entirely programming-focused, requiring complete, syntactically correct C programs using functions, loops, and structures — this section rewards students who have actually written and debugged code repeatedly rather than only read about programming concepts.

Topics Covered

  • Database management systems (records/tuples terminology, hierarchical vs relational models, normalization/2NF)
  • SQL (SELECT statements, WHERE clauses, logical operators)
  • Computer networks (OSI model, transmission media — twisted pair, coaxial, optical fibre)
  • Web scripting — JavaScript (DOM output methods, input handling, conditional logic)
  • Web scripting — PHP (arithmetic operators, MySQL database connectivity, HTML table generation)
  • C programming (increment/decrement operators, user-defined functions, conditional statements, loops, structures, arrays of structures)
  • Object-Oriented Programming (core OOP definition and four pillars: encapsulation, inheritance, polymorphism, abstraction)
  • Software Engineering (feasibility analysis — technical and economic, software development models — Waterfall, Agile, Prototype, Scrum)
  • Emerging technologies (cloud computing, Internet of Things/IoT)

Chapter-wise Weightage (Estimated)

Chapter/UnitApproximate MarksShare
Programming (C, JavaScript, PHP combined)~1836%
Database Management & SQL~918%
Object-Oriented Programming~612%
Computer Networks~918%
Software Engineering (feasibility, models)~510%
Emerging Technologies (cloud, IoT)~36%

Programming across the three languages tested (C, JavaScript, PHP) accounts for over a third of the total marks, confirming that hands-on coding ability is the single most important skill area to strengthen for this paper, followed closely by database/SQL knowledge and networking concepts.

Difficulty Analysis

Group A is more challenging than a typical MCQ section because several questions require tracing through actual code (the PHP modulus example, the C increment operator) or comparing subtly different SQL syntax variants, rather than simply recalling a definition. Group B numericals and short-answer questions are generally approachable for well-prepared students, though the JavaScript and PHP coding options (Q11) demand genuine hands-on scripting practice rather than conceptual familiarity alone. Group C is the most demanding section — writing a complete, correctly structured C program using an array of structures (Q16-OR) requires careful attention to syntax details (array indexing, structure member access, format specifiers in scanf/printf) that are easy to get subtly wrong under exam time pressure, so this section rewards students who have practiced writing full programs repeatedly rather than just reading sample code.

Student Preparation Tips

  1. Practice tracing through PHP, JavaScript, and C code by hand without running it, predicting the exact output — this is directly tested in Group A and builds the code-reading fluency needed for the whole paper.
  2. Write and test SQL queries against sample tables regularly, paying close attention to exact syntax details like repeating column names in compound WHERE/OR conditions, since small syntax errors (as seen in the distractors of Q2) are a common trap.
  3. Build muscle memory for standard C program patterns — user-defined functions, loops generating series, and arrays of structures — by writing these from scratch repeatedly rather than only reading textbook examples, since Group C rewards exact, working syntax.
  4. Memorize the four pillars of OOP with one clear, memorable example each (encapsulation, inheritance, polymorphism, abstraction), since this is a near-guaranteed short-answer question worth several marks.
  5. Keep a comparison table of software development models (Waterfall, Agile, Prototype, Scrum) with their key distinguishing feature, since MCQs often test the ability to match a described characteristic to the correct model name.
  6. Practice writing simple PHP scripts that connect to MySQL and display results in HTML, since this exact pattern (connect → query → loop through results → format as HTML) appears as a five-mark question and rewards students who have set up and tested this connection pattern themselves at least once.

Frequently Asked Questions

Q: How much of this NEB Computer Science paper is actual coding versus theory?
Programming across C, JavaScript, and PHP makes up more than a third of the total marks, and even the “theory” sections (databases, networking) are tested through applied, code-adjacent questions, so hands-on coding practice should be the primary focus of preparation.

Q: Which programming language should I prioritize if I’m short on revision time?
C programming carries the most weight in Group C’s long-answer questions and requires the most precise syntax under exam conditions, so it’s worth prioritizing, though JavaScript and PHP fundamentals (as tested in Group B) shouldn’t be neglected since they offer guaranteed alternative-question marks.

Q: How important is understanding the OSI model and networking cables for this exam?
Very important — networking topics (OSI model MCQs and the transmission media long-answer question) together account for a significant share of marks, and these topics are highly memorizable with consistent, focused revision.

Q: Should I memorize software development model names, or understand their actual differences?
Understanding the actual differences is more valuable — MCQs frequently describe a characteristic (like “strict linear sequential phase order”) and ask you to identify the matching model, so recognition-based memorization of just the names isn’t sufficient.

Q: Is there a risk of encountering errors or inconsistencies in official NEB question papers, like the PHP modulus question here?
Occasionally, yes — as flagged in this analysis for Question 5, transcription or printing inconsistencies can occur, so if a calculated answer doesn’t match an expected option, it’s worth double-checking the arithmetic independently and consulting the official answer key or a teacher rather than assuming your own calculation is wrong.

Conclusion

The NEB Grade XII Computer Science 2083 paper is a genuinely applied, code-heavy exam that rewards students who have spent real time writing, running, and debugging programs in C, JavaScript, and PHP, alongside solid conceptual grounding in databases, networking, and software engineering principles. Working through this paper’s programming questions hands-on — actually typing out and testing the C programs, SQL queries, and scripts rather than just reading through the model solutions — is the most effective way to prepare for the genuine coding demands of the NEB board exam. Use the chapter-wise weightage above to prioritize programming practice first, while keeping steady revision going on databases, networking, and the shorter theory-based topics.