Any2Quiz
CBSE / 11 / ICT / Programming

Control Structures Quiz - CBSE Class 11 ICT

Free practice quiz: Control Structures (CBSE Class 11 ICT). 14 multiple-choice questions with answers and explanations. Play online, no sign-up needed.

Play all 14 questions free

Sample questions

  1. Which control structure is used to repeatedly execute a block of code?

    1. if-else
    2. switch
    3. loop
    4. function
    Show answer

    Answer: C. loop

    Loops (like 'for' and 'while') are designed for repetitive execution of code blocks.

  2. What is the difference between 'while' and 'do-while' loops?

    1. There is no difference
    2. 'while' checks the condition before each iteration, 'do-while' checks after
    3. 'do-while' checks the condition before each iteration, 'while' checks after
    4. They are used in different programming languages
    Show answer

    Answer: B. 'while' checks the condition before each iteration, 'do-while' checks after

    'while' loop checks the condition first, 'do-while' executes the loop body at least once.

  3. What is nested loop?

    1. A loop inside another loop
    2. A loop that never ends
    3. A loop with multiple conditions
    4. A loop that executes only once
    Show answer

    Answer: A. A loop inside another loop

    A nested loop is a loop placed inside another loop.

  4. What is an infinite loop and how can you prevent it?

    1. A loop with a condition that always evaluates to false
    2. A loop with a condition that always evaluates to true
    3. A loop that executes only once
    4. A loop with multiple conditions
    Show answer

    Answer: B. A loop with a condition that always evaluates to true

    An infinite loop occurs when the loop condition never becomes false; proper loop termination conditions are essential to prevent it.

  5. How can you improve the efficiency of a recursive function?

    1. Avoid using recursion altogether
    2. Use memoization to store previously calculated results
    3. Increase the recursion depth
    4. Ignore optimization techniques
    Show answer

    Answer: B. Use memoization to store previously calculated results

    Memoization improves efficiency by storing and reusing previously computed results, thus avoiding redundant calculations.

Take the full quiz

More quizzes

Browse all Programming quizzes