बिजनेस मार्केटिंग का लो कॉस्ट फंडा , अपने मोबाइल से ऑटो sms भेजकर मार्केटिंग करे विजिट करे http://autotextsms.com/ बिजनेस मार्केटिंग का लो कॉस्ट फंडा http://autotextsms.com/

Search This Blog

Translate

How does Switch statement differ from Nested if

How does Switch statement differ from Nested if


Switch
Nested if
Switch can test only for equality
Nested if can evaluate any type of
relational or logical expression
Character constants used in switch
statement are automatically converted to integers
No conversion is required
Syntax:
Switch(expression){
Case constant1:
Statement sequence
Break;
Case constant2:
Statement sequence
Break;
.
.
.
Default
Statement sequence
}

if (condition1)
{
     if (condition2)
     {
          True statement  - 2;
     }
     else
    {
           False statement - 2;
    }
}
else
{
       False statement - 1;
}

How does Switch statement differ from Nested if

C Program example List