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

Answer Posted / fazlur rahaman naik

The main difference between switch - case and if - else is
we can't compare variables.

in the if - else, first the condition is verified,then it
comes to else whereas in the switch - case first it checks
the cases and then it switches to that particular case.

Is This Answer Correct ?    168 Yes 35 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is use of #include in c?

600


Can you please explain the difference between malloc() and calloc() function?

621


Define the scope of static variables.

606


How many data structures are there in c?

619


What is difference between stdio h and conio h?

888






An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above

658


Explain how can I avoid the abort, retry, fail messages?

592


What does dm mean sexually?

814


What are disadvantages of C language.

649


Write a c program to build a heap method using Pointer to function and pointer to structure ?

4179


Is c still used?

604


A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference

634


What is maximum size of array in c?

585


How to delete a node from linked list w/o using collectons?

2090


Explain the concept and use of type void.

631