switch statement in c

Out of multiple if-else statements and a switch statement, which is faster and why?

Comments

  1. the switch statement, dont know the reason.

    ReplyDelete
  2. switch statement in most of the language uses index based table to block of statements, so they are fast in execution compared to multiple if-else.
    for more detailed please read
    http://en.wikipedia.org/wiki/Switch_statement

    ReplyDelete

Post a Comment

Popular posts from this blog