5) Rewrite the following program segment using switch case. char code;
if(code==’B’ || code==’b’)
System.out.println(“Bank Manager”);
if(code==’C’ || code==’c’)
System.out.println(“Chartered Accountant”);
if(code==’E’ || code==’e’)
System.out.println(“Engineer”);
if(code==’M’ || code==’m’)
System.out.println(“Minister”);
Share
0 Replies