predict the output in java....
Attachments:

Answers
Answered by
3
Answer:
Explanation:
(i) p = 1
switch(1)
case 1: a++; ----> a = 2
no break here so it will continue
case 2:++b; -----> b = 3
break;
print(a,b,c) ------> 2,3,3
So output is
2,3,3
(ii) p = 3
switch(3)
case 3:c--; ----> c=2
end of switch
print(a,b,c) ----> 1,2,2
so output is
1,2,2
Hope it helps :-)
Answered by
28
a 1
b 3
c 3
Similar questions
Math,
8 months ago
Math,
8 months ago
Economy,
1 year ago
History,
1 year ago
Social Sciences,
1 year ago