Computer Science, asked by sanjeevlko2794, 11 months ago

int i= 0, a=0,b=0,c=0;
while(i<=5)
switch(i++)
case 1: a++;
case 2:
case 3: b++;
case 4:
default : C++;
System.out.println(a+ " " + b+ " " + c);​

Answers

Answered by Kaustubhkkk
0

Answer:

0 0 1

Explanation:

As i=0

therefore value of i++ = 0 for the termination

the switch case accepts value 0 and goes to case default.

Are you sure that in case default the 'c' is CAPITAL? If it is then the program will show syntax error. If it is not, then you have the answer. Glad to help.

Similar questions