0% found this document useful (0 votes)
9 views12 pages

Switch

The document discusses the behavior of a switch statement in programming, highlighting that only the statement under the matched case will execute. It mentions potential compilation errors if the switch value is not an integer and notes that the order of cases does not affect execution. Additionally, it states that for inputs 1 and 2, 'hello' will be printed, while other cases may lead to no output.

Uploaded by

resam.zaha.hp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views12 pages

Switch

The document discusses the behavior of a switch statement in programming, highlighting that only the statement under the matched case will execute. It mentions potential compilation errors if the switch value is not an integer and notes that the order of cases does not affect execution. Additionally, it states that for inputs 1 and 2, 'hello' will be printed, while other cases may lead to no output.

Uploaded by

resam.zaha.hp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

Switch

Switch
Switch

hi hello
Switch
Switch

65
hihello
The value of case 2,3 and default will be printed
Compilation error, the value of switch should be integer
Only the statement under any case will be executed, so case 24 will be execu
Because of the cyclic nature
Nothing will be printed as there is no case
Ordering of case does not matter
For input 1 and 2 hello will be printed

You might also like