How to reduce to multiple if / else statements..

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • avinash jain
    New Member
    • Aug 2007
    • 12

    How to reduce to multiple if / else statements..

    Could any one guide me how do we reduce nested if / else statements..
  • Savage
    Recognized Expert Top Contributor
    • Feb 2007
    • 1759

    #2
    Originally posted by avinash jain
    Could any one guide me how do we reduce nested if / else statements..
    Read here about switch.

    Savage

    Comment

    • weaknessforcats
      Recognized Expert Expert
      • Mar 2007
      • 9214

      #3
      Are you using C++?

      If so, nested if statements are a sign of packing multiple functions into ine function. Same situation with the switch statement.

      Change the design to use overloaded functions instead.

      Comment

      Working...