Predict the output when i)day=’M’ ii)day=’W’ iii)day=’S’ iv)day=’P’ [4]
char day;
switch(day)
{
case ‘M’: System.out.println(“Let us Work”);
case ‘T’: System.out.println(“Continue to Work”); break;
case ‘W’: System.out.println(“Midday of the week”);
case ‘F’: System.out.println(“Coming to the end of the week”);break;
case ‘S’: System.out.println(“Let us enjoy holiday”);
default: System.out.println(“Let us have fun”);
}
System.out.println(“Thank you”);
Answers
Answered by
2
i) day=’M’
Let us Work
Thank you
ii) day=’W’
Midday of the week
Thank you
iii) day=’S’
Let us enjoy holiday
Thank you
iv) day=’P’
Let us have fun
Thank you
Similar questions