Give Two Differences Between the Switch Statement and the If-else Statement.
Advertisements
प्रश्न
Give two differences between the switch statement and the If-else statement.
अंतर स्पष्ट करें
Advertisements
उत्तर
| S. No. | Switch statement | if-else statement |
| 1. | In this statement, multicodes can be provided in which control transfers to different parts of the code based on the value of an expression. | In this statement, only two codes are based on either a true or a false condition. |
| 2. | Syntax:
|
Syntax:
|
shaalaa.com
Introduction of Object-oriented Programming
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
