हिंदी

Compare the Followingif-else and Switch Statements - Structured Programming Approach

Advertisements
Advertisements

प्रश्न

Compare the following

if-else and switch statements

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

उत्तर

Sr. no. If……else Switch
1 In this we can test only one condition. In this we can test multiple condition.
2 It can have values based on constraints. It can have values based on user choice.
3 In this we cannot have different conditions. In this case we can have only one expression but various value of the same expression.
4 If else statement is used to evaluate a condition to be true or false A switch case statement is used to test for multiple values of the same variable or expression like 1,2,3 etc.

 

shaalaa.com
Control Structures - Nested Control Structure
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
2017-2018 (June) CBCGS

APPEARS IN

Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Course
Use app×