what is the different between if-else and switch statment
(other than syntax)

Answer Posted / vikky

expressions cannot be used as arguments in switsh, but in
if else any kind of exp can be used...
in the case of checkin a single variable for several values
SWITCH is the BEST.
in all other cases if else holds gud.

Is This Answer Correct ?    36 Yes 20 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we use visual studio for c?

540


What is double pointer in c?

581


Explain the binary height balanced tree?

715


a c variable cannot start with a) an alphabet b) a number c) a special symbol d) both b and c above

680


How can I use a preprocessorif expression to ?

592






a construct the"else" part of "if" statement contains anoth "if else" statement is called a) if-else b) else-if-else c) if-else-if-else d) chain if/if-else-if

695


What are valid signatures for the Main function?

694


What is the default value of local and global variables in c?

553


How can I send mail from within a c program?

575


What does it mean when a pointer is used in an if statement?

596


The statement, int(*x[]) () what does in indicate?

640


What is the difference between text and binary i/o?

586


What are the various types of control structures in programming?

621


How can I remove the trailing spaces from a string?

606


What is difference between %d and %i in c?

686