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
Is there any demerits of using pointer?
write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?
What are the types of macro formats?
Why enum is used in c?
Write a progarm to find the length of string using switch case?
What does emoji p mean?
What is a macro in c preprocessor?
How can I delete a file?
What are the functions to open and close file in c language?
How can I avoid the abort, retry, fail messages?
Are pointers really faster than arrays?
int i[2], j; int *pi;i[0] = 1; i[1] = 5; pi = i; j = *pi + 1 + *(pi + 1)Value of j after execution of the above statements will be a) 7 b) 6 c) 4 d) pointer
what is the structure pointer?
What are the functions to open and close the file in c language?
Write a factorial program using C.