- Control Instructions - General Questions
- Control Instructions - Find Output of Program
- Control Instructions - Point Out Errors
- Control Instructions - Point Out Correct Statements
- Control Instructions - True / False Questions
- Control Instructions - Yes / No Questions


Control Instructions - Programming
Q1: Point out the error, if any in the program.
#include<stdio.h>
int main()
{
int P = 10;
switch(P)
{
case 10:
printf('Case 1');
case 20:
printf('Case 2');
break;
case P:
printf('Case 2');
break;
}
return 0;
}
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.
ANS:A - Error: No default value is specified 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. |


For help Students Orientation
Mcqs Questions
One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.