answer this, plsssssss........
Attachments:
Answers
Answered by
2
- Write the alternative coding for the following program so that it avoids number of comparison for the following program code
The above code can be written in following manner.
switch(s)
{
case 1: System.out.println("One.");
break;
case 2: System.out.println("Two.");
break;
case 3: System.out.println("Three");
break;
case 4: System.out.println("Four.");
break;
case 5: System.out.println("Five.");
break;
default: System.out.println("Invalid Choice. ");
}
Similar questions