Vidyalelo
C Programming · Q10

C Miscellaneous

Programming · C Programming · question 10

Q10

Determine Output: void main() int i=3; switch(i) default: printf("zero"); case 1: printf("one"); break; case 2: printf("two"); break; case 3: printf("three"); break;

A.
zero
B.
three
Answer
C.
Error
D.
None of These

Answer: Option B

Solution

Answer: Option B
Solution:

The default case can be placed anywhere inside the loop. It is executed only when all other cases doesn't match.