MCQs
Total Questions : 7
Answer: Option B. -> APPLE= 12
In enum, the value of constant is defined to the recent assignment from left.
Answer: Option B. -> 8
010 is octal representation of 8.
Answer: Option D. -> Compilation Error
The #define substitutes a with 20 leaving no identifier and hence compilation error.
Complilation Error: expected identifier or '(' before numeric constant
Answer: Option A. -> Constant variables need not be defined as they are declared and can be defined later
Since the constant variable has to be declared and defined at the same time, not doing it results in an error.
Hence the statement a is false.
Answer: Option D. -> Error, because a constant variable cannot be changed
Constant variable has to be declared and defined at the same time. Trying to change it later results in error.
Answer: Option B. -> Compile time error
Since the constant variable has to be declared and defined at the same time, not doing it results in an error.