Computer Science, asked by sarkaraaratrika, 6 months ago

Switch (b)
{ case 1: System.out.println (6*5);
break;
case 2: System.out.println (3-2);
case 3: System.out.println (2*3);
break;
default: System.out.println ("wrong choice ");
break;

Write input if (i)b=1, (ii)b=2, (iii)b=3, (iv)b=8​

Answers

Answered by Anonymous
4

Explanation:

public class Test

{

public static void main(String args[])

{

int i = 1, j = 0;

switch(i)

{

case 2: j += 6;

case 4: j += 1;

default: j += 2;

case 0: j += 4;

}

System.out.println("j = " + j);

Similar questions