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

Answer Posted / sumeet

IF ELSE- First the condition is verified, then it comes to the else part.
SWITCH CASE- First it checks the cases and then it switches to that particular case.
IF ELSE- It implements like binary search.
SWITCH CASE-
It implements binary search.

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If one class contains another class as a member, in what order are the two class constructors called a) Constructor for the member class is called first b) Constructor for the member class is called second c) Only one of the constructors is called d) all of the above

626


What is the difference between arrays and pointers?

638


How do you list a file’s date and time?

637


Why main is used in c?

594


What is unary operator?

662






Explain what are compound statements?

608


Does * p ++ increment p or what it points to?

621


Is c call by value?

613


What are unions in c?

586


Why do we need volatile in c?

750


What is #line?

615


What is difference between structure and union in c?

551


Tell me what is null pointer in c?

617


What is the purpose of macro in C language?

668


Explain what are the standard predefined macros?

655