Find the output in the following code snippet int ch=2; switch (ch) { case 1: system.out.println("Desk top"); break; case2: system.out.println("laptop"); case 3: System.out.println ("better than desktop"); }
Answers
Answered by
4
Answer:
laptop
Explanation:
In the switch ch value is passed...which is 2. so case 2 will be executed. it contains laptop so that will be printed.
Similar questions