2. Convert the given code into switch......case (grouping case to be used) if(j==3||j==5)
n=6;
else if(j==4||j==8)
n=9; else if(j==2)
n=8; else
n=0;
Answers
Answered by
0
Answer:
switch (s)
{
case 1:
if(j==3||j==5)
n=6;
System.out.println(n);
case 2:
if(j==4||j==8)
n=9;
System.out.println(n);
case 3:
if(j==2)
n=8;
System.out.println(n);
case 4:
n=0
System.out.println(n);
default :
System.out.println("wrong choose");
}
Similar questions