Computer Science, asked by ravendrasrivastava68, 7 months ago

please tell me this answer ​

Attachments:

Answers

Answered by Oreki
0

Output:

Two Three

Explanation:

As n = 2,

It will go to the second case in the switch statement and will fall-through to the third case because of the absence of break statement.

Answered by Vyomsingh
1

Code:-

int n=2;

switch (n)

{

case 1: //This part will not executed because n≠1

System.out.println("One");

break;

case 2: //This case will executed because n=2

System.out.println("Two");

case 3: //Message of this case will also executed because no break after case 2.

System.out.println("Three");

break;// break found rest of iteration will skip

default:

System.out.println("Wrong input");// This part will skip

}

____________________________________

Output:-

Two

Three

______________________________❤️❤️

HOPE ITS HELP YOU.......☝️

RADHE RADHE ❤️

Similar questions