Discussion :: Control Instructions
-
Point out the error, if any in the program.
#include
A.
Error: No default value is specified |
B.
Error: Constant expression required at line case P: |
C.
Error: There is no break statement in each case. |
D.
No error will be reported. |
Answer : Option B
Explanation :
The compiler will report the error "Constant expression required" in the line case P: . Because, variable names cannot be used with case statements.
The case statements will accept only constant expression.
Be The First To Comment