Prashnikaप्रश्निका
Code
About
Computer ScienceBoardClass 12

ISC Computer Science 2026 Question Paper with Answers

The ISC Computer Science 2026 Question Paper for Class 12: all 39 questions, 70 marks in all, in printed order and in full. It is free to download: tap "Show answer" under a question to see its answer, or use the download button to save the questions as a PDF, with or without answers; "Print this paper" below prints it as it was set.

39questions
70marks
11chapters
Q1(i)1 mark · MCQOpen: According to the Principle of Duality, the Boolean equation Q' · 0 + P' · Q' +…

Choose the correct option.

According to the Principle of Duality, the Boolean equation $Q' \cdot 0 + P' \cdot Q' + P' \cdot Q = P'$ will be equivalent to:
  • (a)$Q \cdot 0 + P \cdot Q + P \cdot Q' = P$
  • (b)$Q' \cdot 1 + P' \cdot Q' + P \cdot Q' = P'$
  • (c)$(Q' + 1) \cdot (P' + Q') \cdot (P' + Q) = P'$
  • (d)$(Q' + 0) \cdot (P' + Q') \cdot (P' + Q) = P'$
Show answer

Answer

Correct option: (c)

Answer: (c) (Q' + 1) • (P' + Q') • (P' + Q) = P' According to the Principle of Duality, each AND operator (•) is replaced by OR (+), each OR operator (+) is replaced by AND (•), and each 0 is replaced by 1, leaving the variables/literals unchanged.
Q1(ii)1 mark · MCQOpen: Consider the following statement written in class Student where school_Name is…

Choose the correct option.

Consider the following statement written in class Student where school_Name is its data member.
static final String school_Name = "Co-Ed School";
Which of the following statements are valid for school_Name? I. All objects of class Student share the same value of school_Name. II. The value of school_Name cannot be changed during program execution. III. The keywords static and final cannot be used together for a variable.
  • (a)Only I and II
  • (b)Only II and III
  • (c)Only I and III
  • (d)Only III
Show answer

Answer

Correct option: (a)

Answer: (a) Only I and II A static variable is a class variable shared by all instances of the class (Statement I is valid), and a final variable is a constant whose value cannot be modified during execution (Statement II is valid). Keywords static and final can be used together in Java.
Q1(iii)1 mark · Assertion-reasonOpen: S1 and S2 are logically equivalent. P = You practise regularly Q = You become…

Study the Assertion and Reason and choose the correct option.

Assertion: S1 and S2 are logically equivalent.

Reason: A conditional statement P => Q can be expressed as ~P V Q

P = You practise regularly Q = You become skilled S1 = $P => Q$ S2 = $\sim P \vee Q$
  • (a)Both Assertion and Reason are true and Reason is the correct explanation for Assertion.
  • (b)Both Assertion and Reason are true but Reason is not the correct explanation for Assertion.
  • (c)Assertion is true and Reason is false.
  • (d)Both Assertion and Reason are false.
Show answer

Answer

Correct option: (a)

Answer: (a) Both Assertion and Reason are true and Reason is the correct explanation for Assertion. The conditional statement P => Q is logically equivalent to ~P v Q by the conditional elimination law. Thus, both statements are true and Reason explains Assertion.
Q1(iv)1 mark · MCQOpen: The Boolean equations a + 1 = 1 and a · 0 = 0 correspond to:

Choose the correct option.

The Boolean equations $a + 1 = 1$ and $a \cdot 0 = 0$ correspond to:
  • (a)Involution Law
  • (b)Law of Identity
  • (c)Distributive Law
  • (d)Law of Complements
Show answer

Answer

Correct option: (b)

Answer: (b) Law of Identity In the syllabus and standard textbook classification of Boolean properties of 0 and 1, operations with 0 and 1 (properties of 0 and 1) are categorized under the identity properties of 0 and 1. None of the other given options (Involution, Distributive, Law of Complements) apply.
Q1(v)1 mark · MCQOpen: The worst case complexity for following code segment is: for(int i=1; i<= n…

Choose the correct option.

The worst case complexity for following code segment is:
for(int i=1; i<= n; i++)
{
    for(int j=1; j<= i; j++)
    {
        statement;
    }
}
  • (a)O(n+i)
  • (b)O(n×i)
  • (c)O(n)
  • (d)O(n²)
Show answer

Answer

Correct option: (d)

Answer: (d) O(n²) The outer loop executes n times and for each i, the inner loop executes i times. Total executions = 1 + 2 + ... + n = n(n + 1)/2, which gives worst case complexity O(n²).
Q1(vi)1 mark · Assertion-reasonOpen: An interface in Java contains abstract and non-abstract methods.

Study the Assertion and Reason and choose the correct option.

Assertion: An interface in Java contains abstract and non-abstract methods.

Reason: All methods in an interface must be implemented by any class that extends this interface.

  • (a)Both Assertion and Reason are true and Reason is the correct explanation for Assertion.
  • (b)Both Assertion and Reason are true but Reason is not the correct explanation for Assertion.
  • (c)Assertion is true and Reason is false.
  • (d)Both Assertion and Reason are false.
Show answer

Answer

Correct option: (d)

Answer: (d) Both Assertion and Reason are false. In standard ISC Java curriculum, an interface contains only abstract method declarations (non-abstract methods belong to abstract classes). Furthermore, a class implements an interface (using the 'implements' keyword), it does not extend it. Hence, both Assertion and Reason are false.
Q1(vii)1 mark · MCQOpen: The complement of the Boolean expression a · b' + a' + a' · b is:

Choose the correct option.

The complement of the Boolean expression $a \cdot b' + a' + a' \cdot b$ is:
  • (a)$a + b' \cdot a' \cdot a' + b$
  • (b)$(a' + b) \cdot a \cdot (a + b')$
  • (c)$(a + b') \cdot a' \cdot (a + b')$
  • (d)$a' \cdot b + a + a \cdot b'$
Show answer

Answer

Correct option: (b)

Answer: (b) (a' + b) • a • (a + b') By De Morgan's laws: (a • b' + a' + a' • b)' = (a • b')' • (a')' • (a' • b)' = (a' + b) • a • (a + b').
Q1(viii)1 mark · Assertion-reasonOpen: The return statement enables the exit of the program control from the current…

Study the Assertion and Reason and choose the correct option.

Assertion: The return statement enables the exit of the program control from the current method.

Reason: If a method's return type is void, it can still contain return 0 statement to return nothing.

  • (a)Both Assertion and Reason are true and Reason is the correct explanation for Assertion.
  • (b)Both Assertion and Reason are true but Reason is not the correct explanation for Assertion.
  • (c)Assertion is true and Reason is false.
  • (d)Both Assertion and Reason are false.
Show answer

Answer

Correct option: (c)

Answer: (c) Assertion is true and Reason is false. The return statement terminates execution of the current method and returns control to the caller (Assertion is true). However, a method with return type void cannot return any value; 'return 0;' causes a compilation error (Reason is false).
Q1(x)1 mark · Short answerOpen: What is Gray code in Karnaugh map?

Answer the following.

What is Gray code in Karnaugh map?
Show answer

Answer

Gray code in a Karnaugh map is a unit-distance binary ordering (00, 01, 11, 10) used to label adjacent rows and columns such that consecutive cells differ by exactly one binary bit. This allows adjacent cells to be combined using Boolean reduction laws.
Q2(i)2 marks · ConversionOpen: P / Q + (S * F + X / R)

Convert the following infix expression to prefix form.

$P / Q + (S * F + X / R)$
Show answer

Answer

Conversion from infix to prefix: Given infix: P / Q + (S * F + X / R) 1. Parenthesized term: (S * F + X / R) - S * F = * S F - X / R = / X R - * S F + / X R = + * S F / X R 2. Division: P / Q = / P Q 3. Addition: (/ P Q) + (+ * S F / X R) = + / P Q + * S F / X R Prefix form: + / P Q + * S F / X R
Q2(ii)2 marks · NumericalOpen: A matrix G[3...7, 2...5] is stored in the memory, with each element requiring 4…

Solve the following.

A matrix G[3...7, 2...5] is stored in the memory, with each element requiring 4 bytes of storage. If the address of G[5][4] is 6000, find the base address when the matrix is stored Column Major Wise.
Show answer

Answer

Row range: 3 to 7 -> Number of rows M = 7 - 3 + 1 = 5 Column range: 2 to 5 -> Number of columns N = 5 - 2 + 1 = 4 Element size W = 4 bytes Given Address(G[5][4]) = 6000 Column Major formula: Address(G[i][j]) = Base Address + W * [(j - Lc) * M + (i - Lr)] Here i = 5, j = 4, Lr = 3, Lc = 2 6000 = Base Address + 4 * [(4 - 2) * 5 + (5 - 3)] 6000 = Base Address + 4 * [2 * 5 + 2] 6000 = Base Address + 4 * [10 + 2] 6000 = Base Address + 4 * 12 6000 = Base Address + 48 Base Address = 6000 - 48 = 5952

Final answer: 5952

Q2(iii)(a)2 marks · OutputOpen: What will the function workOut(220) return?

What is the output of the following code?

What will the function workOut(220) return?
Show the code
The following function workOut( ) is a part of some class. Assume 'n' is a positive integer.
String workOut (int n)
{
    if (n == 0)
        return "";
    int rem = n % 16;
    char cr = (rem < 10) ? (char)(rem + '0') : (char)(rem - 10 + 'A');
    return workOut (n / 16) + cr;
}
Show answer

Answer

Dry run of workOut(220): Call 1: workOut(220) -> rem = 220 % 16 = 12 -> cr = (char)(12 - 10 + 'A') = 'C'; calls workOut(13) + 'C' Call 2: workOut(13) -> rem = 13 % 16 = 13 -> cr = (char)(13 - 10 + 'A') = 'D'; calls workOut(0) + 'D' Call 3: workOut(0) returns "" Unwinding: Call 2 returns "" + 'D' = "D" Call 1 returns "D" + 'C' = "DC" Return value: "DC"
Q2(iv)3 marks · Fill inOpen: The following function isTech( ) is a part of some class which is used to check…

Fill in the blanks marked ?1?, ?2? ... so that the code works.

The following function isTech( ) is a part of some class which is used to check if a given number is a Tech number or not. There are some places in the code marked by ?1? , ?2? , ?3? which may be replaced by a statement / expression so that the function works properly. A number is Tech number if the count of digits is even and the square of the sum of its two equal halves is equal to the number itself. Example: $2025 = 20 + 25 = (45)^2 = 2025$
boolean isTech(int n)
{
    String s = String.valueOf(n);
    int len = ?1?;
    if (len % 2 != 0)
        return ?2?;
    int first = Integer.parseInt(s.substring(0, len / 2));
    int second = Integer.parseInt(s.substring(len / 2));
    int sum = first + second;
    return ?3? == n;
}
Show answer

Answer

Blanks: s.length(); false; sum * sum

?1? = s.length() ?2? = false ?3? = sum * sum
Q3(i)(a)1 mark · Short answerOpen: What is a decoder?

Answer the following.

What is a decoder?
Show answer

Answer

A decoder is a combinational logic circuit that converts binary information from n input lines to a maximum of 2^n unique output lines, activating the line corresponding to the input binary code.
Q3(i)(b)3 marks · DrawingOpen: Draw the logic gate diagram for decoding the binary numbers {0011, 0100, 0101…

Answer the following.

Draw the logic gate diagram for decoding the binary numbers {0011, 0100, 0101, 0111, 1011, 1110} to hexa-decimal numbers.

Draw: logic gate diagram

Show answer

Answer

Logic gate diagram for decoding binary numbers to hexadecimal: Inputs: A, B, C, D and their complements A', B', C', D' via NOT gates. Six 4-input AND gates are connected as follows: - For 0011 (Hex 3): Output = A' • B' • C • D - For 0100 (Hex 4): Output = A' • B • C' • D' - For 0101 (Hex 5): Output = A' • B • C' • D - For 0111 (Hex 7): Output = A' • B • C • D - For 1011 (Hex B): Output = A • B' • C • D - For 1110 (Hex E): Output = A • B • C • D'
Diagram for this answer
Q3(i)(c)1 mark · Short answerOpen: State any one application of a multiplexer.

Answer the following.

State any one application of a multiplexer.
Show answer

Answer

One application of a multiplexer is in data routing / data selection in communication systems, where multiple data sources share a single transmission medium.
Q3(ii)3 marks · DerivationOpen: The Chain rule states that [(a=>b) · (b=>c)] => (a=>c). Prove this rule using…

Prove the following.

The Chain rule states that $[(a=>b) \cdot (b=>c)] => (a=>c)$. Prove this rule using Boolean laws.

Given: $[(a=>b) \cdot (b=>c)]$

To show: (a=>c)

Show answer

Answer

Proof of Chain Rule using Boolean laws: LHS = [(a => b) • (b => c)] => (a => c) = [(a' + b) • (b' + c)] => (a' + c) (Conditional Elimination: x => y = x' + y) = [(a' + b) • (b' + c)]' + (a' + c) (Conditional Elimination) = (a' + b)' + (b' + c)' + a' + c (De Morgan's Law) = (a • b') + (b • c') + a' + c (De Morgan's Law & Involution) = (a' + a • b') + (c + b • c') (Commutative & Associative Laws) = (a' + b') + (c + b) (Redundancy Law / Distributive Law) = a' + c + (b' + b) (Associative Law) = a' + c + 1 (Complement Law: b' + b = 1) = 1 (Properties of 1: x + 1 = 1) Since LHS simplifies to 1 (tautology), the rule is proved.
  1. Step 1: Write implication using conditional law: [(a' + b) • (b' + c)] => (a' + c)
  2. Step 2: Express the outer implication using x => y = x' + y: [(a' + b) • (b' + c)]' + (a' + c)
  3. Step 3: Apply De Morgan's Law to the first term: (a' + b)' + (b' + c)' + a' + c
  4. Step 4: Apply De Morgan's Law and Involution to each subterm: (a • b') + (b • c') + a' + c
  5. Step 5: Rearrange terms using Commutative and Associative laws: (a' + a • b') + (c + b • c')
  6. Step 6: Apply Absorption / Distributive Law (x' + x • y = x' + y): (a' + b') + (c + b)
  7. Step 7: Rearrange terms: a' + c + (b' + b)
  8. Step 8: Apply Complement Law (b' + b = 1): a' + c + 1
  9. Step 9: Apply Properties of 1 (x + 1 = 1): 1
  10. Step 10: Since the expression evaluates to 1, [(a=>b) • (b=>c)] => (a=>c) is identically true.
Q3(iii)(a)1 mark · Short answerOpen: Maxterm

Answer the following.

Maxterm
Show the case
Given that P = 0, Q = 1, R = 0, S = 0, write its:
Show answer

Answer

For P = 0, Q = 1, R = 0, S = 0: Maxterm = P + Q' + R + S
Q3(iii)(b)1 mark · Short answerOpen: Minterm

Answer the following.

Minterm
Show answer

Answer

For P = 0, Q = 1, R = 0, S = 0: Minterm = P' • Q • R' • S'
Q4(i)5 marks · Long answerOpen: According to the ancient laws of the Valley of Peace, a candidate can become…

Answer the following using a truth table.

According to the ancient laws of the Valley of Peace, a candidate can become the Dragon Warrior only if they satisfy any one of the following conditions: • The candidate belongs to the Panda Clan and has been trained for more than 5 years under the Grand Master OR • The candidate possesses the Secret Chi Power but does not belong to the Panda Clan OR • The candidate is recommended by the Grand Master, but neither belongs to the Panda Clan nor has been trained for more than 5 years The inputs are:
INPUTS
CBelongs to the Panda Clan
TTrained for more than 5 years
PPossesses Secret Chi Power
RRecommended by the Grand Master
(In all the above cases, 1 indicates YES and 0 indicates NO) Output: X - Denotes eligibility to become the Dragon Warrior (1 = eligible and 0 = not eligible) Draw the truth table for the inputs and outputs given above. Write the SOP expression for X(C, T, P, R).
Show answer

Answer

Condition 1: C • T Condition 2: C' • P Condition 3: C' • T' • R Eligibility function: X = C • T + C' • P + C' • T' • R Truth Table:
CTPRX
00000
00011
00101
00111
01000
01010
01101
01111
10000
10010
10100
10110
11001
11011
11101
11111
SOP Expression for X(C, T, P, R): In minterm notation: X(C, T, P, R) = Σ(1, 2, 3, 6, 7, 12, 13, 14, 15) Canonical SOP expression: X(C, T, P, R) = C'T'P'R + C'T'PR' + C'T'PR + C'TPR' + C'TPR + CTP'R' + CTP'R + CTPR' + CTPR
Q4(ii)3 marks · DrawingOpen: Construct the logic gate diagram for a Full Adder using two Half Adders.

Draw the following.

Construct the logic gate diagram for a Full Adder using two Half Adders.

Draw: logic gate diagram

Show answer

Answer

Full Adder using two Half Adders: - Inputs: A, B, Cin - HA1: XOR gate gives S1 = A ⊕ B; AND gate gives C1 = A • B - HA2: XOR gate gives Sum S = S1 ⊕ Cin = (A ⊕ B) ⊕ Cin; AND gate gives C2 = S1 • Cin = (A ⊕ B) • Cin - OR gate combines C1 and C2 to produce Carry-out: Cout = C1 + C2 = (A • B) + (A ⊕ B) • Cin In the diagram, HA1 is the XOR and AND gates fed by A and B (outputs S1 and C1), and HA2 is the XOR and AND gates fed by S1 and Cin (outputs Sum and C2).
Diagram for this answer
Q4(iii)2 marks · Truth tableOpen: Draw a truth table to verify if the following proposition is a Tautology, a…

Answer the following using a truth table.

Draw a truth table to verify if the following proposition is a Tautology, a Contradiction or a Contingency. $(A \wedge \sim B) => (\sim A \vee B)$
Show answer

Answer

AB~BA ∧ ~B~A~A ∨ B(A ∧ ~B) => (~A ∨ B)
0010111
0100111
1011000
1100011
The last column has both 1s and 0s, so the proposition is a Contingency.
Q5(i)(a)4 marks · K-mapOpen: Reduce the Boolean function F(A,B,C,D) = π (0,1,2,3,7,8,9,10,11,12,13,15) by…

Reduce the following using a Karnaugh map.

Reduce the Boolean function $F(A,B,C,D) = \pi (0,1,2,3,7,8,9,10,11,12,13,15)$ by using 4-variable Karnaugh map, showing the various groups (i.e., octal, quads and pairs).
Show answer

Answer

Groups: (0, 1, 2, 3, 8, 9, 10, 11) → B; (8, 9, 12, 13) → (A' + C); (3, 7, 11, 15) → (C' + D')

Reduced expression: F = B(A' + C)(C' + D')

Octet (0, 1, 2, 3, 8, 9, 10, 11) gives B. Quad (8, 9, 12, 13) gives (A' + C). Quad (3, 7, 11, 15) gives (C' + D').
Q5(i)(b)1 mark · DrawingOpen: Draw the logic gate diagram for the reduced expression. Assume that the…

Reduce the following using a Karnaugh map.

Draw the logic gate diagram for the reduced expression. Assume that the variables and their complements are available as inputs.

Draw: logic gate diagram

Show answer

Answer

Logic gate diagram for $F = B \cdot (A'+C) \cdot (C'+D')$: two 2-input OR gates (A', C) and (C', D') feed a 3-input AND gate together with B.
Diagram for this answer
Q5(ii)3 marks · Short answerOpen: From the logic gate diagram given below, derive the Boolean expression for (1)…

Answer the following.

From the logic gate diagram given below, derive the Boolean expression for (1), (2) and Q. Reduce the derived expression.
Figure for this question
Show answer

Answer

From the given logic gate diagram: 1. Expression for (1): The top gate is a 3-input AND gate with inputs A, B, and C. (1) = A • B • C 2. Expression for (2): Input A passes through to a 2-input AND gate. Inputs B and C pass through NOT gates to produce B' and C', which enter a 2-input OR gate to produce (B' + C'). The 2-input AND gate takes inputs A and (B' + C'). (2) = A • (B' + C') 3. Expression for Q: Outputs (1) and (2) enter a 2-input OR gate. Q = (1) + (2) = A • B • C + A • (B' + C') 4. Reduction of Q: Q = A • [B • C + (B' + C')] By De Morgan's Law: B' + C' = (B • C)' Q = A • [B • C + (B • C)'] By Complement Law: X + X' = 1 (where X = B • C) Q = A • 1 By Identity Law: Q = A Reduced expression: Q = A
Q5(iii)2 marks · DrawingOpen: Draw the logic gate diagram for 2-input AND gate using NOR gates only. Show the…

Draw the following.

Draw the logic gate diagram for 2-input AND gate using NOR gates only. Show the expression at each step.

Draw: logic gate diagram

Show answer

Answer

Implementation of 2-input AND gate using NOR gates only: Step 1: Invert A using a NOR gate with common inputs: Output 1 = (A + A)' = A' Step 2: Invert B using a NOR gate with common inputs: Output 2 = (B + B)' = B' Step 3: Feed A' and B' into a third NOR gate: Output = (A' + B')' = (A')' • (B')' = A • B
Diagram for this answer
Q610 marks · ProgramOpen: A class TimeOp has been defined to add any two accepted time periods. Example…

Write the program described below.

A class TimeOp has been defined to add any two accepted time periods. Example: Time A = 6 hours 35 minutes 40 seconds Time B = 7 hours 45 minutes 30 seconds Time A + Time B = 14 hours 21minutes 10 seconds (where 60 minutes = 1 hour and 60 seconds = 1 minute) The details of the members of the class are given below: Class name : TimeOp Data member/instance variable: arr[ ] : integer array to hold three elements (hours, minutes and seconds) Methods/Member functions: TimeOp( ) : default constructor void readTime( ) : to accept the elements of the array TimeOp addTime(TimeOp tt) : to add the time of the parameterised object tt and the current object, to store it in a local object and return it void dispTime( ) : to display the array elements in hours:minutes:seconds format Specify the class TimeOp giving the details of the constructor( ), void readTime( ), TimeOp addTime(TimeOp) and void dispTime( ). Define the main( ) function to create objects and call the functions accordingly to enable the task.
Show answer

Answer

import java.util.Scanner;

class TimeOp
{
    int arr[];

    TimeOp()
    {
        arr = new int[3];
    }

    void readTime()
    {
        Scanner sc = new Scanner(System.in);
        System.out.print("Enter hours: ");
        arr[0] = sc.nextInt();
        System.out.print("Enter minutes: ");
        arr[1] = sc.nextInt();
        System.out.print("Enter seconds: ");
        arr[2] = sc.nextInt();
    }

    TimeOp addTime(TimeOp tt)
    {
        TimeOp result = new TimeOp();
        int totalSec = this.arr[2] + tt.arr[2];
        int sec = totalSec % 60;
        int carryMin = totalSec / 60;

        int totalMin = this.arr[1] + tt.arr[1] + carryMin;
        int min = totalMin % 60;
        int carryHr = totalMin / 60;

        int hr = this.arr[0] + tt.arr[0] + carryHr;

        result.arr[0] = hr;
        result.arr[1] = min;
        result.arr[2] = sec;

        return result;
    }

    void dispTime()
    {
        System.out.println(arr[0] + " hours " + arr[1] + " minutes " + arr[2] + " seconds");
    }

    public static void main(String[] args)
    {
        System.out.println("Enter details for first time period:");
        TimeOp t1 = new TimeOp();
        t1.readTime();

        System.out.println("Enter details for second time period:");
        TimeOp t2 = new TimeOp();
        t2.readTime();

        TimeOp t3 = t1.addTime(t2);

        System.out.println("First Time:");
        t1.dispTime();
        System.out.println("Second Time:");
        t2.dispTime();
        System.out.println("Added Time:");
        t3.dispTime();
    }
}
Explanation: The default constructor initialises the array arr of size 3. readTime accepts hours, minutes, and seconds. addTime adds corresponding elements with carry propagation (60 seconds = 1 minute, 60 minutes = 1 hour) and returns a new TimeOp object. dispTime displays the result.
Q7(i)8 marks · ProgramOpen: A class Trimorphic has been defined to accept a positive integer from the user…

Write the program described below.

A class Trimorphic has been defined to accept a positive integer from the user and display if it is a Trimorphic number or not. [A number is said to be Trimorphic if the cube of the number ends with the number itself.] Example 1: $24^3 = 13824$ ends with 24 Example 2: $5^3 = 125$ ends with 5 The details of the members of the class are given below: Class name : Trimorphic Data members/instance variables: n : to store the number cube : to store the cube of the number Methods/Member functions: Trimorphic( ) : constructor to initialise the data members with legal initial values void accept( ) : to accept a number boolean check(int num, long c) : to compare num with the ending digits of c using recursive technique void result( ) : to check whether the given number is a trimorphic number by invoking the function check( ) and to display an appropriate message Specify the class Trimorphic giving the details of the constructor( ), void accept( ), boolean check(int, long) and void result( ). Define the main( ) function to create an object and call the functions accordingly to enable the task.
Show answer

Answer

import java.util.Scanner;

class Trimorphic
{
    int n;
    long cube;

    Trimorphic()
    {
        n = 0;
        cube = 0L;
    }

    void accept()
    {
        Scanner sc = new Scanner(System.in);
        System.out.print("Enter a positive integer: ");
        n = sc.nextInt();
        cube = (long) n * n * n;
    }

    boolean check(int num, long c)
    {
        if (num == 0)
            return true;
        if (num % 10 != c % 10)
            return false;
        return check(num / 10, c / 10);
    }

    void result()
    {
        if (check(n, cube))
            System.out.println(n + " is a Trimorphic number.");
        else
            System.out.println(n + " is not a Trimorphic number.");
    }

    public static void main(String[] args)
    {
        Trimorphic obj = new Trimorphic();
        obj.accept();
        obj.result();
    }
}
Explanation: The constructor initialises n and cube. accept() inputs a positive integer and calculates its cube. check(num, c) recursively compares the last digits of num and c; if num becomes 0, all digits matched and it returns true, otherwise if any pair of digits differ it returns false. result() calls check() and displays the message.
Q7(ii)2 marks · DifferentiateOpen: State any two differences between iteration and recursion.

Differentiate between the following.

State any two differences between iteration and recursion.
Show answer

Answer

Two differences between iteration and recursion: 1. Execution mechanism: Iteration repeatedly executes a block of statements using looping constructs (for, while, do-while) until a condition is satisfied, whereas recursion repeatedly executes code by a method calling itself with a smaller problem until a base condition is reached. 2. Memory overhead: Iteration does not use additional call stack frames for each cycle (O(1) auxiliary stack space), whereas recursion allocates a new stack frame on the call stack for each call, consuming additional memory and carrying the risk of StackOverflowError if the recursion depth is too large.
Q810 marks · ProgramOpen: Design a class PendulumS to perform an operation on a word containing alphabets…

Write the program described below.

Design a class PendulumS to perform an operation on a word containing alphabets in upper case only. Rearrange the word by putting the lowest ASCII value character at the centre and the second lowest ASCII value character to its right and the third to its left and so on. Example 1 : Input : COMPUTER Output : TPMCEORU Example 2 : Input : SCIENCE Output : SIECCEN The details of the members of the class are given below: Class name : PendulumS Data members/instance variables: wrd : to store the original word newwrd : to store the rearranged word Methods/Member functions: PendulumS(String k) : parameterised constructor to initialise wrd = k and newwrd = "" int minCharIndex(String str) : to find the index of the minimum ASCII value character in str and return it void arrange( ) : to rearrange the characters of wrd as per the given instructions and store it in newwrd by invoking minCharIndex( ) void display( ) : to display the original word and the rearranged word Specify the class PendulumS giving the details of the constructor( ), int minCharIndex(String), void arrange( ) and void display( ). Define the main( ) function to create an object and call the functions accordingly to enable the task.
Show answer

Answer

import java.util.Scanner;

class PendulumS
{
    String wrd;
    String newwrd;

    PendulumS(String k)
    {
        wrd = k;
        newwrd = "";
    }

    int minCharIndex(String str)
    {
        int minIdx = 0;
        char minCh = str.charAt(0);
        for (int i = 1; i < str.length(); i++)
        {
            if (str.charAt(i) < minCh)
            {
                minCh = str.charAt(i);
                minIdx = i;
            }
        }
        return minIdx;
    }

    void arrange()
    {
        String temp = wrd;
        int len = wrd.length();
        for (int i = 0; i < len; i++)
        {
            int idx = minCharIndex(temp);
            char ch = temp.charAt(idx);
            temp = temp.substring(0, idx) + temp.substring(idx + 1);

            if (i == 0)
            {
                newwrd = "" + ch;
            }
            else if (i % 2 == 1)
            {
                newwrd = newwrd + ch; // place to the right
            }
            else
            {
                newwrd = ch + newwrd; // place to the left
            }
        }
    }

    void display()
    {
        System.out.println("Original word: " + wrd);
        System.out.println("Rearranged word: " + newwrd);
    }

    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        System.out.print("Enter a word in uppercase: ");
        String input = sc.next();
        PendulumS obj = new PendulumS(input);
        obj.arrange();
        obj.display();
    }
}
Explanation: minCharIndex finds the index of the character with the minimum ASCII value in a string. arrange extracts characters in ascending ASCII order and alternately appends them to the right and prepends them to the left of the center character, forming the pendulum arrangement.
Q9(i)4 marks · ProgramOpen: Specify the class Browser giving details of the functions void visit(String)…

Write the program described below.

Specify the class Browser giving details of the functions void visit(String) and String back( ). Assume that the other functions have been defined.
Show the case
In any internet browser, a user can visit new webpages and go back to previously visited webpages. Each new webpage URL is stored in browser's memory such that when the user clicks 'Back' button, the previous webpage gets displayed. The details of the members of the class are given below: Class name : Browser Data members/instance variables: pages[ ] : an array to hold the URLs of visited webpages max : to store the maximum capacity of the array top : to point to the index of the last visited webpages Methods/Member functions: Browser(int cap) : constructor to assign max = cap and top = -1 void visit(String url) : to add URL of a new webpage if possible, else display the message "Browser history full" String back( ) : to remove and return the last visited webpage URL, if present, else to return the message "No previous browser history"
Show answer

Answer

void visit(String url)
{
    if (top == max - 1)
    {
        System.out.println("Browser history full");
    }
    else
    {
        top++;
        pages[top] = url;
    }
}

String back()
{
    if (top == -1)
    {
        return "No previous browser history";
    }
    else
    {
        String url = pages[top];
        top--;
        return url;
    }
}
Q9(ii)1 mark · Short answerOpen: Name the entity described above and state its principle.

Write the program described below.

Name the entity described above and state its principle.
Show answer

Answer

Entity name: Stack Principle: LIFO (Last In, First Out). The most recently visited URL added to the stack is the first one retrieved when navigating back.
Q105 marks · ProgramOpen: A superclass Hotel has been defined to store the details of a hotel. Define a…

Write the program described below.

A superclass Hotel has been defined to store the details of a hotel. Define a subclass Customer to calculate the total bill for a customer as per the following criteria:
Room typeAdditional Amount
Executive10% of room rent
Suite20% of room rent
The details of the members of both the classes are given below: Class name : Hotel Data members/instance variables: hname : to store hotel name roomrent : to store the rent per day Methods/Member functions: Hotel(...) : parameterised constructor to assign values to its data members void show( ) : to display hotel details Class name : Customer Data members/instance variables: cname : to store customer name days : to store the number of days of stay type : to store the room type surcharge : to store the additional amount amt : to store the total amount Methods/Member functions: Customer(...) : parameterised constructor to assign values to data members of both the classes void compute( ) : to calculate the surcharge based on the room type as given above. Also, to calculate the total amount as: (room rent + surcharge) × days void show( ) : to display hotel and customer details Assume that the superclass Hotel has been defined. Using the concept of Inheritance, specify the class Customer, giving details of constructor(...), void compute( ) and void show( ). The super class, main function and algorithm need NOT be written.
Show answer

Answer

class Customer extends Hotel
{
    String cname;
    int days;
    String type;
    double surcharge;
    double amt;

    Customer(String h, double r, String c, int d, String t)
    {
        super(h, r);
        cname = c;
        days = d;
        type = t;
        surcharge = 0.0;
        amt = 0.0;
    }

    void compute()
    {
        if (type.equalsIgnoreCase("Executive"))
        {
            surcharge = 0.10 * roomrent;
        }
        else if (type.equalsIgnoreCase("Suite"))
        {
            surcharge = 0.20 * roomrent;
        }
        else
        {
            surcharge = 0.0;
        }

        amt = (roomrent + surcharge) * days;
    }

    void show()
    {
        super.show();
        System.out.println("Customer Name: " + cname);
        System.out.println("Days of Stay: " + days);
        System.out.println("Room Type: " + type);
        System.out.println("Surcharge per day: " + surcharge);
        System.out.println("Total Amount: " + amt);
    }
}
Explanation: Customer extends Hotel. The constructor invokes super(h, r) to initialise superclass members and initialises its own data members. compute() calculates surcharge based on room type and computes total amount as (roomrent + surcharge) * days. show() calls super.show() and displays customer details.
Q11(i)2 marks · ProgramOpen: A linked list is formed from the objects of the class Word. The structure of…

Write the program described below.

A linked list is formed from the objects of the class Word. The structure of the class Word is given below:
class Word
{
    String value;
    Word next;
}
Write an Algorithm OR a Method to count and display the number of nodes whose value starts with a consonant. The method declaration is as follows: void countConsonant(Word first)
Show answer

Answer

void countConsonant(Word first)
{
    int count = 0;
    Word current = first;
    while (current != null)
    {
        if (current.value != null && current.value.length() > 0)
        {
            char ch = Character.toUpperCase(current.value.charAt(0));
            if (Character.isLetter(ch) && ch != 'A' && ch != 'E' && ch != 'I' && ch != 'O' && ch != 'U')
            {
                count++;
            }
        }
        current = current.next;
    }
    System.out.println("Number of nodes starting with a consonant: " + count);
}
Explanation: The method traverses the linked list starting from the first node. For each node, it checks if the first character of value is an alphabetic character and not a vowel (A, E, I, O, U). If so, count is incremented. After traversing the list, the count is displayed.
Q11(ii)(a)1 mark · Binary treeOpen: Write the pre-order traversal of the above tree.

Answer the following questions from the binary tree.

Write the pre-order traversal of the above tree.
Show answer

Answer

Pre-order traversal (Root -> Left -> Right): M, N, P, Q, T, U, O, R, S, V, W
Q11(ii)(b)1 mark · Binary treeOpen: State the level of Node Q, when the root is at level 0.

Answer the following questions from the binary tree.

State the level of Node Q, when the root is at level 0.
Show answer

Answer

Level of Node Q = 2 (Root M is at level 0; nodes N, O are at level 1; nodes P, Q, R, S are at level 2).
Q11(ii)(c)1 mark · Binary treeOpen: State the size of the left subtree and the right subtree.

Answer the following questions from the binary tree.

State the size of the left subtree and the right subtree.
Show answer

Answer

Size of the left subtree = 5 (nodes: N, P, Q, T, U) Size of the right subtree = 5 (nodes: O, R, S, V, W)

About this board paper

The ISC Computer Science 2026 Question Paper is a board paper for Class 12: 39 questions in printed order, 70 marks in all, asked from 11 chapters. The board paper is the exam itself: the question paper CISCE set for that year’s ISC candidates. Solve it in one sitting, in the time allowed, to see how questions are worded and how hard the real paper is.

The layout of the current Computer Science paper (sections, marks, choices) is in the paper pattern guide.

By kind of question

KindQuestionsMarks printed*
Program639
Short answer911
Drawing49
MCQ55
Long answer15
K-map14
Assertion-reason33
Binary tree33
Derivation13
Fill in13
Differentiate12
Conversion12
Numerical12
Output12
Truth table12

By chapter

ChapterQuestionsMarks printed*
Boolean Algebra1323
Computer Hardware613
Recursion413
Data structures712
Arrays, Strings212
Objects110
Inheritance, Interfaces and Polymorphism26
Implementation of algorithms to solve problems13
Complexity and Big O notation11
Methods11
Variables, Expressions11

* Marks are those printed on each question; where a question offers an either-or choice, both options are counted, so the totals can come to more than the paper’s own total.

Common questions

How many questions are in the ISC Computer Science 2026 Question Paper?

39 questions, 70 marks in all, shown in full and in printed order on this page.

Which chapters does the ISC Computer Science 2026 Question Paper ask most about?

By number of questions: Boolean Algebra (13), Data structures (7), Computer Hardware (6) and Recursion (4).

Does this page have the answers to the ISC Computer Science 2026 Question Paper?

Tap “Show answer” under a question to see its answer. The download button saves the paper as a PDF, with or without the answers.