Problem Statement - if-else-if to switch-case
Convert the following if else if construct into switch case
if( var==1)
System.out.println(“good”);
else if(var==2)
System.out.println(“better”);
else if(var==3)
System.out.println(“best”);
else
System.out.println(“invalid”);
Solution
sunmitra| Created: 25-Mar-2018 | Updated: 12-Apr-2019|ICSE2018