Computer Science, asked by saiteja134, 1 year ago

differentiate between if and switch statements

Answers

Answered by AasthaSinha
4
If is used to execute a statement or block of statements
Switch .... used to conditionally perform statements based on an integer expression
Answered by Anonymous
0

The if statement evaluates integer, character, pointer or floating-point type or Boolean type. On the other hand, switch statement evaluates only character or an integer data type. Sequence of execution is like either statement under if block will execute or statements under else block statement will execute.

xxxxxxxxxxxxxxxxxxxxxx

Similar questions