Sample PapersISCClass 11Computer Science

ISC Class 11 Computer Science Sample Paper 2026-27 with Solutions

A full 70-mark ISC Class 11 Computer Science sample paper for the 2026-27 annual exam: MCQs, number systems, propositional logic, logic gates, Java classes, arrays, strings, searching and sorting, and computing ethics, with complete worked solutions.

24 min read
ISC Class 11 Computer Science Sample Paper 2026-27 with Solutions

Class 11 is the year to build your base for the ISC board exam. This is a full ISC Class 11 Computer Science sample paper in the same format as the Class 12 theory paper. It covers number systems, propositional logic, logic gates, Java classes and objects, arrays, strings, searching and sorting, and ethics in computing. Attempt it in 3 hours, then check every answer against the worked solutions at the end.

COMPUTER SCIENCE – SAMPLE PAPER 2026-27

Class XI | Maximum Marks: 70 | Time Allowed: Three Hours

Candidates are allowed an additional 15 minutes for reading the paper only. They must NOT start writing during this time.
Answer all questions in Part I and the questions from Part II as instructed in each section. Programs must be written in Java. The intended marks for questions or parts of questions are given in brackets [ ].

PART I – 20 Marks (Answer all questions)

Question 1 – Multiple Choice Questions [10 × 1]

(i) What is (45)₁₀ in binary?

  • (a) 101011
  • (b) 101101
  • (c) 110101
  • (d) 100101

(ii) What is (3A7)₁₆ in decimal?

  • (a) 935
  • (b) 937
  • (c) 925
  • (d) 953

(iii) What is the 2's complement of (0101100)₂?

  • (a) 1010011
  • (b) 1010100
  • (c) 1010101
  • (d) 0101101

(iv) Which of the following is a universal gate?

  • (a) AND
  • (b) OR
  • (c) NAND
  • (d) XOR

(v) When is the proposition p ⇒ q false?

  • (a) p is true and q is true
  • (b) p is true and q is false
  • (c) p is false and q is true
  • (d) p is false and q is false

(vi) What is the size of the int data type in Java?

  • (a) 2 bytes
  • (b) 4 bytes
  • (c) 8 bytes
  • (d) It depends on the machine

(vii) What is the output of "COMPUTER".substring(3).indexOf('U')?

  • (a) 4
  • (b) 1
  • (c) 0
  • (d) -1

(viii) What is the wrapper class of the char data type?

  • (a) Char
  • (b) Character
  • (c) String
  • (d) Charset

(ix) Which keyword refers to the current object inside a method?

  • (a) super
  • (b) this
  • (c) new
  • (d) static

(x) Which type of software licence allows users to view, modify and redistribute the source code?

  • (a) Freeware
  • (b) Shareware
  • (c) Open-source
  • (d) Proprietary

Question 2 – Short Answer Questions [5 × 2]

(i) Convert (725)₈ into binary and then into hexadecimal. [2]

(ii) State both of De Morgan's laws. [2]

(iii) What is the difference between a primitive data type and a reference data type? [2]

(iv) Give the output of the following code: [2]

int a[] = {3, 6, 9, 12};
int s = 0;
for (int i = 0; i < a.length; i += 2)
    s += a[i];
System.out.println(s);

(v) What is the purpose of the this keyword? Give an example. [2]

PART II – 50 Marks

SECTION A – Logic and Hardware (Answer all questions)

Question 3 [5]

(a) Using a truth table, verify that p ⇒ q ≡ ~p ∨ q. [2]

(b) Show that [(p ⇒ q) ∧ p] ⇒ q is a tautology. [3]

Question 4 [10]

(a) Why are NAND and NOR called universal gates? Show how to build NOT, AND and OR gates using only NAND gates. [4]

(b) Draw the truth table of the XOR gate and write its Boolean expression. [3]

(c) Convert (101101.101)₂ into decimal. [3]

SECTION B – Java Programming (Answer any two questions)

Question 5 [10]

A perfect number equals the sum of its factors, excluding the number itself. Example: 28 = 1 + 2 + 4 + 7 + 14.

Design a class Perfect with the following details:

  • Data member: int num
  • Perfect(int n): parameterised constructor
  • int sumOfFactors(): returns the sum of the factors of num, excluding num
  • void check(): prints whether num is a perfect number

Specify the class and write the main() function.

Question 6 [10]

Design a class Sentence that accepts a sentence and prints the following:

  • the number of words
  • the sentence with each word reversed in place
  • the frequency of the letter 'A' (ignoring case)

Example: for the input Java is easy, the output is "Words: 3", "Reversed: avaJ si ysae" and "Frequency of A: 3".

Question 7 [10]

Write a program to input an M × N matrix, where 2 ≤ M, N ≤ 10. Print the matrix together with the sum of each row and each column. If the size is out of range, display "Invalid size".

SECTION C – Algorithms and Computing Ethics (Answer all questions)

Question 8 [5]

Write a method void selectionSort(int a[]) to sort an integer array in ascending order using selection sort. Show the state of the array after each pass for the input {29, 10, 14, 37, 13}.

Question 9 [5]

(a) Write a method int linearSearch(int a[], int key) that returns the index of key in the array, or −1 if it is not present. [3]

(b) State two differences between linear search and binary search. [2]

Question 10 [5]

(a) What is plagiarism? [1]

(b) State two differences between proprietary software and open-source software. [2]

(c) What is cybercrime? Give two examples. [2]

SOLUTIONS

Attempt the full paper before checking these.

Solutions to Question 1

Converting 45 to binary by repeated division by 2

(i) (b) 101101. 32 + 8 + 4 + 1 = 45.

(ii) (a) 935. 3 × 256 + 10 × 16 + 7 = 768 + 160 + 7 = 935.

(iii) (b) 1010100. The 1's complement is 1010011, and adding 1 gives 1010100.

(iv) (c) NAND. NAND and NOR are the universal gates.

(v) (b) p is true and q is false. An implication is false only when a true premise leads to a false conclusion.

(vi) (b) 4 bytes. Java's sizes are fixed on every platform.

(vii) (b) 1. substring(3) gives "PUTER", and 'U' is at index 1 in it.

(viii) (b) Character

(ix) (b) this

(x) (c) Open-source

Solutions to Question 2

(i) Replace each octal digit with 3 bits:

7 → 111,  2 → 010,  5 → 101
(725)₈ = (111 010 101)₂

Regroup in 4s from the right: 0001 1101 0101
                                1     D     5
(725)₈ = (1D5)₁₆

Check: 7×64 + 2×8 + 5 = 469, and 1×256 + 13×16 + 5 = 469.

(ii)

  • (A + B)' = A' · B'
  • (A · B)' = A' + B'

In words, the complement of a sum is the product of the complements, and the complement of a product is the sum of the complements.

(iii) A primitive type (such as int, char or double) stores the actual value directly in the variable. A reference type (such as String, arrays or user-defined classes) stores the memory address of an object, and its default value is null.

(iv) Output: 12. i takes the values 0 and 2, so s = a[0] + a[2] = 3 + 9 = 12.

(v) this refers to the current object. It is mainly used to tell instance variables apart from parameters that have the same name.

class Student {
    String name;
    Student(String name) {
        this.name = name;   // this.name is the data member
    }
}

Solution to Question 3

(a)

 p  q | ~p | p ⇒ q | ~p ∨ q
 T  T |  F |   T   |   T
 T  F |  F |   F   |   F
 F  T |  T |   T   |   T
 F  F |  T |   T   |   T

The last two columns are identical, so p ⇒ q ≡ ~p ∨ q. Hence verified.

(b)

 p  q | p ⇒ q | (p ⇒ q) ∧ p | [(p ⇒ q) ∧ p] ⇒ q
 T  T |   T   |      T      |        T
 T  F |   F   |      F      |        T
 F  T |   T   |      F      |        T
 F  F |   T   |      F      |        T

The final column is true in every row, so the expression is a tautology. This rule of reasoning is called Modus Ponens.

Solution to Question 4

(a) NAND and NOR are called universal gates because any Boolean function, and therefore any other gate, can be built using only NAND gates or only NOR gates.

  • NOT using NAND: join both inputs to A. Output = (A · A)' = A'
  • AND using NAND: NAND A and B, then pass the result through a NAND gate wired as NOT. Output = ((A · B)')' = A · B
  • OR using NAND: invert A and B with two NAND gates wired as NOT, then NAND the results. Output = (A' · B')' = A + B, by De Morgan's law

(b)

 A  B | A ⊕ B
 0  0 |   0
 0  1 |   1
 1  0 |   1
 1  1 |   0

A ⊕ B = A'B + AB'. The output is 1 only when the inputs are different.

(c)

Integer part: 101101 = 32 + 8 + 4 + 1 = 45
Fraction part: .101  = 1×2⁻¹ + 0×2⁻² + 1×2⁻³
                     = 0.5 + 0 + 0.125 = 0.625
(101101.101)₂ = (45.625)₁₀

Solution to Question 5

import java.util.Scanner;

class Perfect {
    int num;

    Perfect(int n) {
        num = n;
    }

    int sumOfFactors() {
        int s = 0;
        for (int i = 1; i <= num / 2; i++) {
            if (num % i == 0)
                s += i;
        }
        return s;
    }

    void check() {
        if (num > 1 && sumOfFactors() == 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: ");
        Perfect ob = new Perfect(sc.nextInt());
        ob.check();
    }
}

Sample run: 28 gives "28 is a Perfect number". The loop only needs to go up to num / 2, because no factor other than num itself is larger than num / 2.

Solution to Question 6

import java.util.Scanner;

class Sentence {
    String s;

    void accept() {
        Scanner sc = new Scanner(System.in);
        System.out.print("Enter a sentence: ");
        s = sc.nextLine().trim();
    }

    int countWords() {
        if (s.length() == 0)
            return 0;
        int c = 1;
        for (int i = 0; i < s.length(); i++)
            if (s.charAt(i) == ' ' && s.charAt(i + 1) != ' ')
                c++;
        return c;
    }

    String reverseWords() {
        String temp = s + " ", word = "", res = "";
        for (int i = 0; i < temp.length(); i++) {
            char ch = temp.charAt(i);
            if (ch != ' ')
                word = ch + word;          // adding at the front reverses the word
            else if (word.length() > 0) {
                res += word + " ";
                word = "";
            }
        }
        return res.trim();
    }

    int countA() {
        int c = 0;
        for (int i = 0; i < s.length(); i++)
            if (Character.toUpperCase(s.charAt(i)) == 'A')
                c++;
        return c;
    }

    public static void main(String args[]) {
        Sentence ob = new Sentence();
        ob.accept();
        System.out.println("Words: " + ob.countWords());
        System.out.println("Reversed: " + ob.reverseWords());
        System.out.println("Frequency of A: " + ob.countA());
    }
}
In countWords(), s.charAt(i + 1) is safe because trim() guarantees the sentence does not end with a space.

Solution to Question 7

import java.util.Scanner;

class MatrixSum {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        System.out.print("Enter rows and columns: ");
        int m = sc.nextInt(), n = sc.nextInt();
        if (m < 2 || m > 10 || n < 2 || n > 10) {
            System.out.println("Invalid size");
            return;
        }
        int a[][] = new int[m][n];
        System.out.println("Enter the elements:");
        for (int i = 0; i < m; i++)
            for (int j = 0; j < n; j++)
                a[i][j] = sc.nextInt();

        for (int i = 0; i < m; i++) {
            int rowSum = 0;
            for (int j = 0; j < n; j++) {
                System.out.print(a[i][j] + "\t");
                rowSum += a[i][j];
            }
            System.out.println("| " + rowSum);
        }

        for (int j = 0; j < n; j++) {
            int colSum = 0;
            for (int i = 0; i < m; i++)
                colSum += a[i][j];
            System.out.print(colSum + "\t");
        }
        System.out.println();
    }
}

Sample run for a 2 × 3 matrix with the rows {1, 2, 3} and {4, 5, 6}:

1	2	3	| 6
4	5	6	| 15
5	7	9

Solution to Question 8

Selection sort passes for 29 10 14 37 13
void selectionSort(int a[]) {
    int n = a.length;
    for (int i = 0; i < n - 1; i++) {
        int min = i;
        for (int j = i + 1; j < n; j++)
            if (a[j] < a[min])
                min = j;
        int t = a[i];          // swap the smallest element into position i
        a[i] = a[min];
        a[min] = t;
    }
}

The array after each pass:

Start : 29 10 14 37 13
Pass 1: 10 29 14 37 13   (10 swapped into position 0)
Pass 2: 10 13 14 37 29   (13 swapped into position 1)
Pass 3: 10 13 14 37 29   (14 is already in place)
Pass 4: 10 13 14 29 37   (29 swapped into position 3)

Solution to Question 9

(a)

int linearSearch(int a[], int key) {
    for (int i = 0; i < a.length; i++) {
        if (a[i] == key)
            return i;
    }
    return -1;
}

(b)

  • Linear search works on both sorted and unsorted arrays. Binary search works only on a sorted array.
  • Linear search checks the elements one by one and makes up to n comparisons, so it is O(n). Binary search halves the search range each time, so it is O(log n) and much faster for large arrays.

Solution to Question 10

(a) Plagiarism means presenting another person's work, ideas or code as your own without giving them credit.

(b)

  • The source code of proprietary software is closed and owned by a company, so users cannot modify or redistribute it. The source code of open-source software is freely available to view, modify and share.
  • Proprietary software usually has to be bought or licensed (for example MS Office), while open-source software is usually free of cost (for example LibreOffice or Linux).

(c) Cybercrime is any criminal activity that involves a computer, a network or the internet. Examples include phishing (stealing passwords through fake emails or websites), hacking (gaining unauthorised access to a system), identity theft and cyberbullying.

Preparation Tips for Class 11

  • Practise number conversions (binary, octal, decimal and hexadecimal) until you make no mistakes. They are easy marks.
  • Learn to draw complete truth tables with a column for every intermediate step.
  • Write the class description (data members and methods) before the code in every Java question.
  • Do at least one array or string program every day. Most Class 12 practical questions are built on these skills.

Study the theory alongside this paper with our ISC Class 11 notes on Propositional Logic and the Class 11 solved programs section.