What output is produced by the following code? int top= 4, n= -1; while ( n <= t
ID: 3544637 • Letter: W
Question
What output is produced by the following code?
int top= 4, n= -1;
while ( n <= top)
{
switch(n)
{
case 1:
System.out.println( " One ");
break;
case 3:
System.out.println( " Three ");
break;
case 4:
System.out.println( " Four ");
break;
default:
System.out.println( " Default case. ");
break;
}
n++;
Explanation / Answer
Default case
Default case
One
Default case
Three
Four
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.