Advertisements
Advertisements
प्रश्न
Convert the following construct as directed:
if-else-if construct into switch case:
if (var == 1)
System.out.println("Distinction");
else if (var == 2)
System.out.println("First Division");
else if (var == 3)
System.out.println("Second Division");
else
System.out.println("invalid");
थोडक्यात उत्तर
उत्तर
switch (var)
{case 1: System.out.println("Distinction"); break;
case 2: System.out.println("First Division"); break
case 3: System.out.println("Second Division"); break;
default: System.out.println("invalid");
}
shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?