switch(input)
{
case '1': printf("One");
case '2': printf("Two");
case '3': printf("'"Three");
default: Printf("Default");
break;
}
What will be printed when input is 2?
Select one:
O a. Two
O b. Two Three
O c Two Three default
d. Error
Answers
Answered by
0
Answer:
The given program is written in Python:-
Using the switch statement
It will give an error as the break statement is not applied after each statement there will be 'Fall through' in the program.
Also there is an error in the last as break comes first and then default.
So answer is error.
Similar questions