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
What is c token?
Explain is it valid to address one element beyond the end of an array?
what is different between auto and local static? why should we use local static?
How is a structure member accessed?
What is difference between function overloading and operator overloading?
What are identifiers c?
Here is a good puzzle: how do you write a program which produces its own source code as output?
What do you mean by dynamic memory allocation in c? What functions are used?
In c programming, explain how do you insert quote characters (? And ?) Into the output screen?
Can a variable be both constant and volatile?
can any one provide me the notes of data structure for ignou cs-62 paper
Why is c fast?
Explain what is wrong with this statement? Myname = ?robin?;
Write a program to swap two numbers without using third variable?
How can I make sure that my program is the only one accessing a file?