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

Define circular linked list.

564


Explain how does free() know explain how much memory to release?

567


What is a scope resolution operator in c?

740


What are identifiers c?

558


Describe the header file and its usage in c programming?

611






How are pointers declared in c?

590


Which is better oop or procedural?

620


List a few unconditional control statement in c.

555


How do I send escape sequences to control a terminal or other device?

602


Subtract Two Number Without Using Subtraction Operator

348


Why can’t we compare structures?

801


How will you write a code for accessing the length of an array without assigning it to another variable?

611


How #define works?

607


What is function prototype in c language?

606


Explain what is the advantage of a random access file?

650