In the following control structure which is faster?
1.Switch
2.If-else
and which consumes more memory?
Answer Posted / deepak upadhyay
switch statement is more faster and consumes less memory
than if-else statement the reason being that the switch
statement is applied when we have a single variable to
check but in case of if-else different variable may be
checked at the same time.
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.
Why does this code crash?
What is sorting in c plus plus?
Can you explain the four storage classes in C?
Can you mix old-style and new-style function syntax?
How to define structures? ·
What is Dynamic memory allocation in C? Name the dynamic allocation functions.
What does nil mean in c?
a construct the"else" part of "if" statement contains anoth "if else" statement is called a) if-else b) else-if-else c) if-else-if-else d) chain if/if-else-if
Can 'this' pointer by used in the constructor?
What is a void * in c?
What's the total generic pointer type?
How can I ensure that integer arithmetic doesnt overflow?
What are the ways to a null pointer can use in c programming language?
write a progrmm in c language take user interface generate table using for loop?