Computer Science, asked by danish751, 1 year ago

write

difference between if statement and switch statement

Answers

Answered by anchal2002
7
‘IF’ and ‘SWITCH’ are the conditional statements used by programming languages.

‘IF’ statement basis on the result and is used in nests as well depending on the requirement. ELSE is used in combination with IF statements to construct a complete statement or do a computation of more than one result. 

The ‘SWITCH’ statement is also a conditional statement used in programming languages for logical and conditional computing. SWITCH uses CASE and DEFAULT within its structure to perform a conditional task. The SWITCH statement is preferred in cases where there is a lengthy list that needs to be compared with the variable. It is also the preferred conditional statement used by the programmers with its easy flow and efficient proofreading aspect.

I hope it is helpful for you

Plz ✔️ Mark as Brainliest
Similar questions