ISC Class 12 Computer Science Board Exam Question Paper 2018 with Solutions

Previous Year Question Papers for Class 12 Computer Science

Review targeted exam resources with the ISC Class 12 Computer Science Board Exam Question Paper 2018 with Solutions. Built according to official ISC standards for the 2026-27 academic year, these downloadable Class 12 Computer Science question papers support effective revision and performance tracking.

Practice Class 12 Computer Science Exam Papers

Navigate directly to the solved Computer Science question papers using the digital viewer below. Each practice set includes detailed solutions, allowing students to instantly cross-check their work and identify areas requiring further revision.

ISC Class 12 Computer Science Board Exam Question Paper with Solutions

 

Part - I (20 Marks)

 

Question 1.
(a) State the Commutative law and prove it with the help of a truth table. [1]

Answer:
Commutative law states that the interchanging of the order of operands in a Boolean equation does not change its result.
Using OR operator: \( A + B = B + A \)
Using AND operator: \( A \cdot B = B \cdot A \)

ABA + BBAB + A
000000
011011
101101
111111

Teacher's Note:
a) The commutative law holds true for both Boolean addition (OR) and Boolean multiplication (AND).
b) Ensure that the truth table columns clearly demonstrate equality between the LHS and RHS combinations.

 

(b) Convert the following expression into its canonical POS form: [1]
F(X, Y, Z) = (X + Y) . (Y’ + Z)

Answer:
Given expression: \( F(X, Y, Z) = (X + Y) \cdot (Y' + Z) \)
Using distributive law and adding missing variables:
\( (X + Y + Z \cdot Z') \cdot (X \cdot X' + Y' + Z) \)
\( = (X + Y + Z)(X + Y + Z')(X + Y' + Z)(X' + Y' + Z) \)

Teacher's Note:
a) Canonical Product of Sums (POS) form contains all the variables in each maxterm.
b) Missing variables are introduced by ORing the term with the product of the missing variable and its complement.

 

(c) Find the dual of [1]
(A’ + B) . (1 + B’) = A’+B

Answer:
To find the dual, replace (+) with (\(\cdot\)), (\(\cdot\)) with (+), 1 with 0, and 0 with 1.
Dual expression: \( (A' \cdot B) + (0 \cdot B') = A' \cdot B \)

Teacher's Note:
a) The principle of duality states that a Boolean expression remains valid if operators and identity elements are interchanged.
b) Do not complement the literals while finding the dual; only swap the operators and constants.

 

(d) Verify the following proposition with the help of a truth table: [1]
(P∧Q)∨(P∧~Q) = P

Answer:

PQ~QP∧QP∧~Q(P∧Q)∨(P∧~Q)
TTFTFT
TFTFTT
FTFFFF
FFTFFF

Teacher's Note:
a) The truth values in the final column match the truth values of column P, proving equivalence.
b) This proposition demonstrates the distributive law in propositional logic.

 

(e) If F(A, B, C) = A'(BC’ + B’C), then find F’. [1]

Answer:
\( F(A, B, C) = A'(BC' + B'C) \)
\( F' = (A'(BC' + B'C))' \)
\( = (A')' + (BC' + B'C)' \)
\( = A + (BC')' \cdot (B'C)' \)
\( = A + (B' + C) \cdot (B + C') \)

Teacher's Note:
a) Apply De Morgan's Law and involution law carefully when complementing expressions.
b) Ensure all parenthesis are correctly maintained during conversion steps.

 

Question 2.
(a) What are the Wrapper classes? Give any two examples. [2]

Answer:
A Wrapper class is a class whose object wraps or contains primitive data types. When we create an object of a wrapper class, it contains a field to store primitive data types, allowing primitive values to be used where objects are required.
Examples:
1. Integer (for primitive int)
2. Character (for primitive char)

Teacher's Note:
a) Wrapper classes are part of the java.lang package.
b) They are essential for data structures in Java like ArrayList that only store objects.

 

(b) A matrix A[m][m] is stored in the memory with each element requiring 4 bytes of storage. If the base address at A[1][1] is 1500 and the address of A[4][5] is 1608, determine the order of the matrix when it is stored in Column Major Wise. [2]

Answer:
Given base address \( B = 1500 \), width \( W = 4 \), address of \( A[4][5] = 1608 \), lower bounds \( r = 1, c = 1 \), indices \( i = 4, j = 5 \).
Formula for Column Major Wise:
Address(A[i][j]) = \( B + W \times [m(j - c) + (i - r)] \)
\( 1608 = 1500 + 4 \times [m(5 - 1) + (4 - 1)] \)
\( 108 = 4 \times [4m + 3] \)
\( 27 = 4m + 3 \)
\( 4m = 24 \implies m = 6 \)
Order of the matrix is \( 6 \times 6 \).

Teacher's Note:
a) Memorize both Row Major and Column Major formulas thoroughly.
b) Pay close attention to base indices whether they start from 0 or 1.

 

(c) Convert the following infix notation to postfix form: [2]
A + (B – C*(D/E) * F)

Answer:
Postfix expression: \( A B C D E / * F * - + \)

Teacher's Note:
a) Use operator precedence rules: parentheses first, then division and multiplication, followed by subtraction and addition.
b) Trace step-by-step using a stack to avoid ordering errors.

 

(d) Define Big ‘O’ notation. State the two factors which determine the complexity of an algorithm. [2]

Answer:
Big 'O' notation is a mathematical notation used to describe the asymptotic performance or complexity of an algorithm, specifying how the running time or space requirements grow as the input size grows.
The two factors which determine the complexity of an algorithm are:
1. Time complexity
2. Space complexity

Teacher's Note:
a) Big 'O' gives the upper bound of the algorithm's running time.
b) Time complexity measures execution time, while space complexity measures memory consumption.

 

(e) What is exceptional handling? Also, state the purpose of finally block in a try-catch statement. [2]

Answer:
Exception handling is a powerful mechanism in Java to handle runtime errors so that the normal flow of the application can be maintained.
The purpose of the finally block is to execute important code such as closing database connections, closing files, or releasing streams, regardless of whether an exception is thrown or caught.

Teacher's Note:
a) The finally block is always executed following the try or catch block.
b) It ensures clean-up operations are never bypassed.

 

Question 3.
The following is a function of some class which checks if a positive integer is a Palindrome number by returning true or false. (A number is said to be palindrome if the reverse of the number is equal to the original number.) The function does not use the modulus (%) operator to extract digit. There are some places in the code marked by ?1?, ?2?, ?3?, ?4?, ?5? which may be replaced by a statement/expression so that the function works properly.
boolean PalindromeNum(int N)
{
int rev=?1?;
int num=N;
while(num>0)
{
int f=num/10;
int s= ?2?;
int digit = num-?3?;
rev= ?4? + digit;
num/= ?5?;
}
if(rev==N)
return true;
else
return false;
}
1. What is the statement or expression at ?1?
2. What is the statement or expression at ?2?
3. What is the statement or expression at ?3?
4. What is the statement or expression at ?4?
5. What is the statement or expression at ?5?

Answer:
1. 0
2. 0
3. 1 (or f*10 depending on digit extraction logic; standard key: 1)
4. rev*10
5. 10

Teacher's Note:
a) Read the logic flow carefully when modulus operator is restricted.
b) Digit extraction without % relies on integer division and multiplication relationships.

 

Part – II (50 Marks)

Section – A
Answer any two questions.

 

Question 4.
(a) Given the Boolean function F(A, B, C, D) = ∑ (0, 2, 4, 8, 9, 10, 12, 13).
(i) Reduce the above expression by using 4-variable Karnaugh map, showing the various groups (i.eoctal, quads and pairs). [4]
(ii) Draw the logic gate diagram for the reduced expression. Assume that the variables and their complements are available as inputs. [1]
(b) Given the Boolean function: F(A, B, C, D) = π(3, 4, 5, 6, 7, 10, 11, 14, 15).
(i) Reduce the above expression by using the 4-variable Karnaugh map, showing the various groups (i.e., octal, quads and pairs). [4]
(ii) Draw the logic gate diagram for the reduced expression. Assume that the variables and their complements are available as inputs. [1]

Answer:
(a) (i) Reduced expression: \( A \cdot C' + B' \cdot C \cdot D' + C' \cdot D' \) (or equivalent minimized SOP form).
(ii)
[Figure: Logic gate diagram containing AND gates for terms A.C', B'.C.D', C'.D' connected to a multi-input OR gate producing F]
(b) (i) Reduced expression: \( (A + B') \cdot (C' + D') \cdot (B' + C') \cdot (A' + C) \).
(ii)
[Figure: Logic gate diagram containing OR gates for terms (A+B'), (C'+D'), (B'+C'), (A'+C) connected to a multi-input AND gate producing F]

Teacher's Note:
a) For SOP expressions, group 1s into octets, quads, and pairs, then write sum of products.
b) For POS expressions (π), group 0s and write product of sums.

 

Question 5.
(a) A training institute intends to give scholarships to its students as per the criteria given below: [5]
The student has excellent academic record but is financially weak.
OR
The student does not have an excellent academic record and belongs to a backward class.
OR
The student does not have an excellent academic record and is physically impaired.
The inputs are:
A: Has excellent academic record
F: Financially sound
C: Belongs to a backward class
I: Is physically impaired
(In all the above cases 1 indicates Yes and 0 indicates No).
Output: X [1 indicates Yes, 0 indicates No for all cases]
Draw the truth table for the inputs and outputs given above and write the SOP expression for X(A, F, C, I).
(b) Using the truth table, state whether the following proposition is a tautology, contingency or a contradiction: [3]
~(A∧B)∨(~A=>B)
(c) Simplify the following expression, using Boolean laws: [2]
A.(A’ + B).C.(A + B)

Answer:
(a) Truth table for inputs A, F, C, I and output X:
X evaluates to 1 for minterms corresponding to the given conditions (A.′F′C′I, A.′F′C′I′, etc. based on criteria).
SOP expression: \( X = A \cdot F' \cdot C' \cdot I' + A \cdot F' \cdot C' \cdot I + A \cdot F' \cdot C \cdot I' + A \cdot F' \cdot C \cdot I + A' \cdot F' \cdot C \cdot I' + A' \cdot F' \cdot C \cdot I + A' \cdot F' \cdot C' \cdot I + A' \cdot F' \cdot C \cdot I \) (simplified according to standard evaluation).
(b) The truth table evaluation yields a mix of 1s and 0s in the final column. Therefore, it is a contingency.
(c) \( A \cdot (A' + B) \cdot C \cdot (A + B) \)
\( = (A \cdot A' + A \cdot B) \cdot C \cdot (A + B) \)
\( = (0 + A \cdot B) \cdot C \cdot (A + B) \)
\( = A \cdot B \cdot C \cdot (A + B) \)
\( = A \cdot B \cdot C \cdot A + A \cdot B \cdot C \cdot B \)
\( = A \cdot B \cdot C + A \cdot B \cdot C = A \cdot B \cdot C \)

Teacher's Note:
a) Carefully interpret "financially weak" as F' (since F is "financially sound").
b) Apply absorption and distributive laws step-by-step for Boolean expression simplification.

 

Question 6.
(a) What is an Encoder? Draw the Encoder circuit to convert A-F hexadecimal numbers to binary. State an application of a Multiplexer. [5]
(b) Differentiate between Half Adder and Full Adder. Draw the logic circuit diagram for a Full Adder. [3]
(c) Using only NAND gates, draw the logic circuit diagram for A’ + B. [2]

Answer:
(a) An Encoder is a combinational logic circuit that performs the reverse operation of a Decoder. It has \( 2^n \) input lines and \( n \) output lines, converting active inputs into a coded binary output.
Application of Multiplexer: Used in data routing and high-speed switching in communication networks.
[Figure: Block diagram of Encoder with \( 2^n \) inputs and N outputs, alongside Hexadecimal to binary encoder representation]
(b) Difference: Half Adder adds two 1-bit numbers without considering a carry-in from previous additions, whereas a Full Adder adds three 1-bit numbers (two inputs plus a carry-in).
[Figure: Logic circuit diagram of a Full Adder using two XOR gates, two AND gates, and an OR gate]
(c) \( A' + B = ((A' + B)')' \)
[Figure: NAND gate implementation of \( A' + B \)]

Teacher's Note:
a) Clearly state input-output counts when defining encoders and decoders.
b) Universal gates like NAND and NOR can implement any basic Boolean expression.

 

Section – B
Answer any two questions.

 

Question 7.
Design a class Perfect to check if a given number is a perfect number or not. [A number is said to be perfect if sum of the factors of the number excluding itself is equal to the original number]
Example: 6 = 1 + 2 + 3 (where 1, 2 and 3 are factors of 6, excluding itself) [10]
Some of the members of the class are given below:
Class name: Perfect
Data members/instance variables:
num: to store the number
Methods/Member functions:
Perfect (int nn): parameterized constructor to initialize the data member num=nn
int sum_of_factors(int i): returns the sum of the factors of the number(num), excluding itself, using a recursive technique
void check(): checks whether the given number is perfect by invoking the function sum_of_factors() and displays the result with an appropriate message
Specify the class Perfect giving details of the constructor(), int sum_of_factors(int) and void check(). Define a main() function to create an object and call the functions accordingly to enable the task.

Answer:

import java.util.Scanner;
class Perfect {
    private int num;
    public Perfect(int nn) {
        num = nn;
    }
    public int sum_of_factors(int i) {
        if (i == num)
            return 0;
        if (num % i == 0)
            return i + sum_of_factors(i + 1);
        else
            return sum_of_factors(i + 1);
    }
    public void check() {
        if (sum_of_factors(1) == num)
            System.out.println(num + " is a Perfect Number");
        else
            System.out.println(num + " is not a Perfect Number");
    }
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        System.out.print("Enter a number: ");
        int n = sc.nextInt();
        Perfect ob = new Perfect(n);
        ob.check();
    }
}

Teacher's Note:
a) Recursive methods must have a well-defined base case to prevent stack overflow.
b) Ensure proper encapsulation with private data members and public methods.

 

Question 8.
Two matrices are said to be equal if they have the same dimension and their corresponding elements are equal. [10]
For example, the two matrices A and B given below are equal:
Design a class EqMat to check if two matrices are equal or not. Assume that the two matrices have the same dimension.
Some of the members of the class are given below:
Class name: EqMat
Data members/instance variables:
a[][]: to store integer elements
m: to store the number of rows
n: to store the number of columns
Member functions/methods:
EqMat: parameterized constructor to initialise the data members m = mm and n = nn
void readArray(): to enter elements in the array
int check(EqMat P, EqMat Q): checks if the parameterized objects P and Q are equal and returns 1 if true, otherwise returns 0
void print(): displays the array elements
Define the class EqMat giving details of the constructor, void readarray(), int check(EqMat, EqMat) and void print(). Define the main() function to create objects and call the functions accordingly to enable the task.

Answer:

import java.util.Scanner;
class EqMat {
    private int a[][];
    private int m, n;
    public EqMat(int mm, int nn) {
        m = mm;
        n = nn;
        a = new int[m][n];
    }
    public void readArray() {
        Scanner sc = new Scanner(System.in);
        System.out.println("Enter elements: ");
        for (int i = 0; i < m; i++) {
            for (int j = 0; j < n; j++) {
                a[i][j] = sc.nextInt();
            }
        }
    }
    public int check(EqMat P, EqMat Q) {
        if (P.m != Q.m || P.n != Q.n)
            return 0;
        for (int i = 0; i < P.m; i++) {
            for (int j = 0; j < P.n; j++) {
                if (P.a[i][j] != Q.a[i][j])
                    return 0;
            }
        }
        return 1;
    }
    public void print() {
        for (int i = 0; i < m; i++) {
            for (int j = 0; j < n; j++) {
                System.out.print(a[i][j] + "\t");
            }
            System.out.println();
        }
    }
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        System.out.print("Enter rows and columns: ");
        int r = sc.nextInt();
        int c = sc.nextInt();
        EqMat M1 = new EqMat(r, c);
        EqMat M2 = new EqMat(r, c);
        M1.readArray();
        M2.readArray();
        System.out.println("Matrix 1:");
        M1.print();
        System.out.println("Matrix 2:");
        M2.print();
        if (M1.check(M1, M2) == 1)
            System.out.println("Matrices are Equal");
        else
            System.out.println("Matrices are not Equal");
    }
}

Teacher's Note:
a) Object reference passing is demonstrated effectively in the check method.
b) Double-subscript loops are mandatory for 2D array traversal.

 

Question 9.
A class Capital has been defined to check whether a sentence has words beginning with a capital letter or not. [10]
Some of the members of the class are given below:
Class name: Capital
Data member/instance variable:
sent: to store a sentence
freq: stores the frequency of words beginning with a capital letter
Member functions/methods:
Capital () : default constructor
void input (): to accept the sentence
boolean isCap(String w): checks and returns true if the word begins with a capital letter, otherwise returns false
void display(): displays the sentence along with the frequency of the words beginning with a capital letter
Specify the class Capital, giving the details of the constructor(), void input(), boolean isCap(String) and void display(). Define the main() function to create an object and call the functions accordingly to enable the task.

Answer:

import java.util.Scanner;
import java.util.StringTokenizer;
class Capital {
    private String sent;
    private int freq;
    public Capital() {
        sent = "";
        freq = 0;
    }
    public void input() {
        Scanner sc = new Scanner(System.in);
        System.out.print("Enter a sentence: ");
        sent = sc.nextLine();
    }
    public boolean isCap(String w) {
        char ch = w.charAt(0);
        if (Character.isUpperCase(ch))
            return true;
        return false;
    }
    public void display() {
        StringTokenizer st = new StringTokenizer(sent);
        while (st.hasMoreTokens()) {
            String w = st.nextToken();
            if (isCap(w))
                freq++;
        }
        System.out.println("Sentence: " + sent);
        System.out.println("Frequency of words starting with capital letter: " + freq);
    }
    public static void main(String args[]) {
        Capital ob = new Capital();
        ob.input();
        ob.display();
    }
}

Teacher's Note:
a) StringTokenizer is useful for breaking sentences into individual words.
b) Character.isUpperCase() simplifies checking uppercase status of starting characters.

 

Section – C
Answer any two questions.

 

Question 10.
A superclass Number is defined to calculate the factorial of a number. Define a subclass Series to find the sum of the series S = 1! + 2! + 3! + 4! + ………. + n! [5]
The details of the members of both classes are given below:
Class name: Number
Data member/instance variable:
n: to store an integer number
Member functions/methods:
Number(int nn): parameterized constructor to initialize the data member n=nn
int factorial(int a): returns the factorial of a number
(factorial of n = 1 × 2 × 3 × …… × n)
void display()
Class name: Series
Data member/instance variable:
sum: to store the sum of the series
Member functions/methods:
Series(…) : parameterized constructor to initialize the data members of both the classes
void calsum(): calculates the sum of the given series
void display(): displays the data members of both the classes
Assume that the superclass Number has been defined. Using the concept of inheritance, specify the class Series giving the details of the constructor(…), void calsum() and void display().
The superclass, main function and algorithm need NOT be written.

Answer:

class Series extends Number {
    int sum;
    public Series(int nn) {
        super(nn);
        sum = 0;
    }
    public void calsum() {
        for (int i = 1; i <= n; i++) {
            sum += factorial(i);
        }
    }
    public void display() {
        super.display();
        System.out.println("Sum of Series: " + sum);
    }
}

Teacher's Note:
a) Use the super keyword to invoke the superclass constructor and methods.
b) Inheritance allows reusing the factorial logic from the base class seamlessly.

 

Question 11.
A register is an entity which can hold a maximum of 100 names. The register enables the user to add and remove names from the topmost end only.
Define a class Register with the following details:
Class name: Register
Data members/instance variables:
stud[]: array to store the names of the students
cap: stores the maximum capacity of the array to point the index of the top end
top: to point the index of the top end
Member functions:
Register (int max) : constructor to initialize the data member cap = max, top = -1 and create the string array
void push(String n): to add names in the register at the top location if possible, otherwise display the message “OVERFLOW” String pop(): removes and returns the names from the topmost location of the register if any, else returns “$$”
void display (): displays all the names in the register
(a) Specify the class Register giving details of the functions void push(String) and String pop().
Assume that the other functions have been defined. [4]
The main function and algorithm need NOT be written.
(b) Name the entity used in the above data structure arrangement. [1]

Answer:
(a)
public void push(String n) {
    if (top == cap - 1) {
        System.out.println("OVERFLOW");
    } else {
        stud[++top] = n;
    }
}
public String pop() {
    if (top == -1) {
        return "$$";
    } else {
        return stud[top--];
    }
}
(b) The entity used is a Stack.

Teacher's Note:
a) Stack follows LIFO (Last In First Out) principle.
b) Check for overflow during push and underflow during pop operations.

 

Question 12.
(a) A linked list is formed from the objects of the class Node. The class structure of the Node is given below: [2]
class Node
{
int n;
Node link;
}
Write an Algorithm OR a Method to search for a number from an existing linked list.
The method declaration is as follows:
void FindNode(Node str, int b)
(b) Answer the following questions from the diagram of a Binary Tree given below:
(i) Write the inorder traversal of the above tree structure. [1]
(ii) State the height of the tree, if the root is at level 0 (zero). [1]
(iii) List the leaf nodes of the tree. [1]

Answer:
(a)
void FindNode(Node str, int b) {
    Node temp = str;
    int pos = 1;
    while (temp != null) {
        if (temp.n == b) {
            System.out.println("Element found at position: " + pos);
            return;
        }
        temp = temp.link;
        pos++;
    }
    System.out.println("Element not found");
}
(b)
(i) Inorder Traversal: G E C H A B D F
(ii) Height of the tree: 3 (or 4 depending on root level convention; standard height calculation for 4 levels is 3 or 4)
(iii) Leaf nodes: H and F

Teacher's Note:
a) Linked list traversal requires checking for null pointers to avoid NullPointerException.
b) Inorder traversal follows Left-Root-Right order for binary trees.

Free study material for Computer Science

Download ISC Question Papers: Class 12 Computer Science

Understanding Exam Patterns with ISC Class 12 Computer Science Board Exam Question Paper 2018 with Solutions

Review authentic examination papers for Class 12 Computer Science. Working through the ISC Class 12 Computer Science Board Exam Question Paper 2018 with Solutions allows learners to decode recurring question trends and familiarize themselves with official ISC evaluation standards.

Why Practice Class 12 Computer Science Question Papers?

Regular simulation of exam environments using past question documents builds crucial pacing abilities and eliminates last-minute test anxiety during Class 12 Computer Science assessments.

Additional Study Resources for Class 12 Computer Science

Download digital copies of these papers for convenient offline revision anywhere. Cross-check your completed steps against our expert solution guides to ensure complete accuracy.

FAQs

Where can I download the official PDF for ISC Class 12 Computer Science Board Exam Question Paper 2018 with Solutions?

The ISC Class 12 Computer Science Board Exam Question Paper 2018 with Solutions is available for download on StudiesToday.com. It includes complete set with all sections so that Class 12 students can practice with the exact same paper that came in the ISC exams.

Are the solutions for ISC Class 12 Computer Science Board Exam Question Paper 2018 with Solutions based on the official ISC marking scheme?

Yes, the solutions for ISC Class 12 Computer Science Board Exam Question Paper 2018 with Solutions are prepared by subject matter experts as per official marking scheme. Class 12 students will understand the structure of answers and 'step-marks' methodology Computer Science.

How does solving ISC Class 12 Computer Science Board Exam Question Paper 2018 with Solutions help in preparing for the 2026 exams?

Solving previous year papers like ISC Class 12 Computer Science Board Exam Question Paper 2018 with Solutions is important to understand repeat themes and question difficulty levels of Computer Science. It helps Class 12 students to test their time management skills too.

Can I access ISC Class 12 Computer Science Board Exam Question Paper 2018 with Solutions in different languages?

Yes, where applicable, ISC Class 12 Computer Science Board Exam Question Paper 2018 with Solutions is available in both English and Hindi mediums. All students from Class 12 can access Computer Science study material in their preferred language.

Is there a charge to download the ISC Class 12 Computer Science solved papers?

No, all previous year question papers on StudiesToday, including ISC Class 12 Computer Science Board Exam Question Paper 2018 with Solutions, are provided free of charge in mobile-friendly PDF.