Computer Science, asked by shrest37, 1 year ago

Explain Switch statement by yourself

Answers

Answered by Anonymous
2
<b><marquee behavior ="alternate">ANSWER:</marquee></marquee>

[tex]<b><u>The switch statement is used when there is requirement to check multiple conditions in a program.</tex]

It provides an easy way to branch to different parts of the code in a program based on the value of expression.

It is a substitute of large series of if else if statements. This control structure has a switch statement, which stores an expression.

The value of the switch statement is compared to the labels of all the cases. If the expression matches, the statements associated with that cases get excuted.
Answered by rekhaverma02021975
0

The switch statement is used when there is a requirement to check multiple condition in a program.

Similar questions