In the following control structure which is faster?
1.Switch
2.If-else
and which consumes more memory?

Answer Posted / battini.laxman

switch is faster because when in nested if condition has to
check for each time. where as in switch it diectly check
only labels.

Is This Answer Correct ?    8 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is meant by recursion?

642


How can you read a directory in a C program?

666


Do you know what are bitwise shift operators in c programming?

601


What are the uses of a pointer?

693


Can you apply link and association interchangeably?

689






Which built-in library function can be used to match a patter from the string?

761


How do you determine whether to use a stream function or a low-level function?

668


Define Spanning-Tree Protocol (STP)

665


How can I implement a delay, or time a users response, with sub-second resolution?

641


What are formal parameters?

671


Are c and c++ the same?

646


Explain about C function prototype?

621


What is merge sort in c?

659


Is c language still used?

550


What is the use of in c?

589