Any2Quiz
CBSE / 11 / ICT / Programming

Variables and Data Types Quiz - CBSE Class 11 ICT

Free practice quiz: Variables and Data Types (CBSE Class 11 ICT). 20 multiple-choice questions with answers and explanations. Play online, no sign-up needed.

Play all 20 questions free

Sample questions

  1. Which of the following is NOT a valid variable name in most programming languages?

    1. myVariable
    2. 1stVariable
    3. _myVar
    4. my_variable
    Show answer

    Answer: B. 1stVariable

    Variable names usually cannot start with a number.

  2. What data type is used to represent a sequence of characters?

    1. Integer
    2. Float
    3. Boolean
    4. String
    Show answer

    Answer: D. String

    Strings are used to store text.

  3. What is the purpose of a data type?

    1. To determine the size and type of data a variable can hold
    2. To organize data in a program
    3. To make code look nicer
    4. To control how data is accessed
    Show answer

    Answer: A. To determine the size and type of data a variable can hold

    Data types define the kind of values a variable can store and the operations that can be performed on it.

  4. Describe the concept of variable scope in programming.

    1. The range of values a variable can hold
    2. The data type of a variable
    3. The part of a program where a variable is accessible
    4. The name of a variable
    Show answer

    Answer: C. The part of a program where a variable is accessible

    Scope determines the visibility and accessibility of a variable.

  5. Discuss the importance of choosing appropriate data types for variables in terms of efficiency and memory usage.

    1. Data type choice has no impact on efficiency or memory
    2. Larger data types are always more efficient
    3. Smaller data types are always better
    4. Choosing appropriate data types optimizes memory usage and program speed
    Show answer

    Answer: D. Choosing appropriate data types optimizes memory usage and program speed

    Efficient data type selection leads to optimized resource usage.

Take the full quiz

More quizzes

Browse all Programming quizzes