constants Questions and Answers
Practice ModeShowing 10 of 30 questions
Q21
What is the advantage of using #define over const?
Answer: Option D
Explanation: #define doesn't allocate memory, const does
Q22
Which constant cannot be modified?
Answer: Option A
Explanation: const variables cannot be modified after initialization
Q23
What is the size of const int?
Answer: Option D
Explanation: const doesn't change the size of data type
Q24
How to make a constant floating point value?
Answer: Option B
Explanation: Use const float or const double
Q25
What is the problem with: const int x; x=10;?
Answer: Option D
Explanation: const variables must be initialized at declaration
Q26
Which is correct for constant array?
Answer: Option D
Explanation: const applies to array elements
Q27
What does const in function parameter mean?
Answer: Option D
Explanation: const parameter cannot be modified inside function
Q28
How to define multiple constants in one line?
Answer: Option B
Explanation: Multiple constants can be declared with comma separation
Q29
What is enum constant in C?
Answer: Option A
Explanation: enum defines named integer constants
Q30
Which is true about #define constants?
Answer: Option C
Explanation: #define constants have no type checking