Control Instructions

Q1:
We want to test whether a value lies in the range 2 to 4 or 5 to 7. Can we do this using a switch?

A No

B Yes

ANS:A - Yes

We can do this in following switch statement

switch(a)
{
    case 2:
    case 3:
    case 4:
       /* some statements */
       break;
    case 5:
    case 6:
    case 7:
       /* some statements */
       break;
}



img not found
img

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.