Warning: implode(): Invalid arguments passed in /www/wwwroot/jobquiz.info/mdiscuss.php on line 336 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; } ?->(Show Answer!)
1. 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; }
Ask Your Doubts Here
Comments
By: guest on 01 Jun 2017 06.01 pm
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.