C programming Language AND C++ programming Language (OOPs) QUESTION WITH SOLUTIONS ARE IN This BLOG. Placement Question with solutions ,Technical Placement question,Technical Placement question with Answer,Technical Placement question with Solution or other Links
if the case match with an expression execution start from the case.
Example : void main()
if none of the case are satisfied then the default case is satisfied
example : void main()
case 10: printf(“ I am a reader”);
case 11:printf(“I am writer”);
default: printf(“I am programmer”);
3.case character must be integral constant.
4.break is used to prevent the falling of control from one case to another case
5. case can in any order.
6.In the switch statement , the keyword ‘continue ‘ cannot be used in place of ‘break’. The compiler will generate an error message . the use of continue will not take the control to the beginning of switch as one is likely to believe.
7.duplicate case is not allowed.
8. the default case is optional . if there is no match case and there is no default case , then the compiler does not report the error.
9.case character can be constant or constant expression but not variable.
10. if 0 is given as an argument in if , while and do-while , it evaluates to false but in switch it evaluates as an expression.