हिंदी

Differentiate between the switch and if-else statements.

Advertisements

प्रश्न

Differentiate between the switch and if-else statements.

Differentiate between the switch statement and the if-else statement in Java.

अंतर स्पष्ट करें
Advertisements

उत्तर

Switch statement if-else statement
The switch statement uses a single expression for multiple choices. The if-else statement uses multiple statements for multiple choices.
The switch statement tests only for equality. if-else statement tests for equality as well as for logical expressions.
The switch statement executes one case af­ter another till a break statement appears or the end of the switch statement is reached. Either the if statement will be executed or the else statement will be executed.
shaalaa.com
Php Conditional Statements
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 6: PHP Conditional Statements - Evaluation - PART – III [पृष्ठ १११]

APPEARS IN

सामाचीर कलवी Computer Applications [English] Class 12 TN Board
अध्याय 6 PHP Conditional Statements
Evaluation - PART – III | Q 3. | पृष्ठ १११
धीरज मेहरोत्रा Computer Science [English] Class 12
अध्याय 7 Statements and their Scope
EXERCISE | Q 3. (ii) | पृष्ठ १६३
Advertisements
Share
Notifications



      Forgot password?
Use app×