اردو

Home / Practice / Class 12 / Computer Science / Programming and arrays

Programming and arrays

5 Class 12 Computer Science questions with answers and explanations.

Printable worksheet with answer key

All questions with answers
  1. An array stores:

    • 1 Multiple values of the same type
    • 2 Only one value
    • 3 Only text
    • 4 Only images
    Show answer

    Correct answer: Multiple values of the same type

    An array holds a list of items.

    Report a mistake

  2. The first index of an array in C is:

    • 1 Depends on the size
    • 2 -1
    • 3 1
    • 4 0
    Show answer

    Correct answer: 0

    Arrays are indexed from 0.

    Report a mistake

  3. A function is used to:

    • 1 Compile only
    • 2 Group code that can be reused
    • 3 Print only
    • 4 Delete code
    Show answer

    Correct answer: Group code that can be reused

    Functions make code reusable.

    Report a mistake

  4. Which of these is a relational operator?

    • 1 +
    • 2 >
    • 3 &
    • 4 =
    Show answer

    Correct answer: >

    The greater than sign compares values.

    Report a mistake

  5. The number of times `for (i = 0; i < 5; i++)` runs its body is:

    • 1 6
    • 2 0
    • 3 5
    • 4 4
    Show answer

    Correct answer: 5

    i takes values 0 to 4, so five times.

    Report a mistake

More Computer Science topics