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
0
Answer:
invalid will be the answer
Answered by
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
Political Science,
3 months ago
Science,
3 months ago
Hindi,
3 months ago
Business Studies,
6 months ago
Biology,
10 months ago
Math,
10 months ago
Computer Science,
10 months ago