Computer Science, asked by itzzritu, 6 months ago

Explain switch case
statement ????????​

Answers

Answered by ap5495989
1

Answer:

Switch statement in C tests the value of a variable and compares it with multiple cases. Once the case match is found, a block of statements associated with that particular case is executed. ... If a case match is NOT found, then the default statement is executed, and the control goes out of the switch block.

Answered by Anonymous
1

Answer:

Switch statement in C tests the value of a variable and compares it with multiple cases. Once the case match is found, a block of statements associated with that particular case is executed.

Each case in a block of a switch has a different name/number which is referred to as an identifier. The value provided by the user is compared with all the cases inside the switch block until the match is found.

If a case match is NOT found, then the default statement is executed, and the control goes out of the switch block.

Similar questions