Ix) main(){ int i=3; switch(i) { default:printf("zero"); case 1: printf("one"); break; case 2:printf("two"); break; case 3: printf("three"); break; } }

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

Questions by Beena   answers by Beena

Showing Answers 1 - 2 of 2 Answers

Lakshmi Prabha

  • Oct 22nd, 2005
 

the output will be three because when execution takes place ,inside the switch the corresponding case 3(since i=3)is selected and as there is a break statement after it, it cmes out of the loop.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions