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 freeSample questions
Which of the following is NOT a valid variable name in most programming languages?
- myVariable
- 1stVariable
- _myVar
- my_variable
Show answer
Answer: B. 1stVariable
Variable names usually cannot start with a number.
What data type is used to represent a sequence of characters?
- Integer
- Float
- Boolean
- String
Show answer
Answer: D. String
Strings are used to store text.
What is the purpose of a data type?
- To determine the size and type of data a variable can hold
- To organize data in a program
- To make code look nicer
- 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.
Describe the concept of variable scope in programming.
- The range of values a variable can hold
- The data type of a variable
- The part of a program where a variable is accessible
- 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.
Discuss the importance of choosing appropriate data types for variables in terms of efficiency and memory usage.
- Data type choice has no impact on efficiency or memory
- Larger data types are always more efficient
- Smaller data types are always better
- 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.