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 the use of parallelize in spark?

777


What is linear search?

919


Why is main function so important?

852


What is null character in c?

889


What is #include stdio h?

912


What is the condition that is applied with ?: Operator?

899


i want to know the procedure of qualcomm for getting a job through offcampus

2210


What is wrong in this statement?

823


Why isnt there a numbered, multi-level break statement to break out

829


How many levels of pointers can you have?

944


Do you know the use of fflush() function?

820


What is meant by high-order and low-order bytes?

856


What are identifiers c?

868


Define Spanning-Tree Protocol (STP)

888


Why isn't any of this standardized in c? Any real program has to do some of these things.

949