switch-case is similar to _____________________ statement. / स्विच-केस _____________ कथन के समान है। *
if else
if-else- if
break
goto
Answers
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
Explanation:
i think goto answer
Option(b) is correct.
Concept:
The switch statement in C is a replacement for the if-else-if ladder statement, and it allows us to do several actions for the various potential values of a single variable called switch variable. Here, we may construct several statements for different values of a single variable in multiple situations.
Find:
The case which is similar to switch function.
Solution:
if-else checks only one condition and it is not similar to switch function. Option(a) is incorrect.
The switch statement in C is a replacement for the if-else-if ladder statement, and it allows us to do several actions for the various potential values of a single variable called switch variable. Option(b) is correct.
break statement exits from the loop. Option(c) is incorrect.
goto statement jumps to the specified location. Option(d) is incorrect.
#SPJ3