Computer Science, asked by smitachatterjee98, 6 months ago

Consider the following code –

switch(n)

{

Case 1: System.out.println(“ONE”);

Case 2: System.out.println(“Two”);

Case 3 : System.out.println(“Three”);

Break;

Case 4 : System.out.println(“Four”);

Break;

Default : System.out.println(“ Invalid”);

}

What will be the output of the above code, if value of n is-

i) 1 ii) 3 ii) -7​

Answers

Answered by mohammadfaizbahraizh
0

Answer:

invalid will be the answer

Answered by 8472
1

Answer:

in first case 1,2,3 all will excecute absence of break fall through program

in second case 3 will be executed

in third default will execute

hope it helps pls mark it as brainliest and follow me pls.....

Similar questions