In the following control structure which is faster?
1.Switch
2.If-else
and which consumes more memory?
Answer Posted / abhradeep chatterjee
According to me, switch is faster. cause in nested if-
else, the checking occurs in each step. So, more the
compiler checks, the more it takes time. So switch case is
faster.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
How #define works?
Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?
Tell me with an example the self-referential structure?
Tell me when would you use a pointer to a function?
How do I send escape sequences to control a terminal or other device?
An arrangement of information in memory in such a way that it can be easily accessed and processed by a programming language a) string b) data structure c) pointers d) array
What is difference between array and pointer in c?
Who is the main contributor in designing the c language after dennis ritchie?
What is the difference between test design and test case design?
Write a program for finding factorial of a number.
Are enumerations really portable?
a) Identify the following declarations. Ex. int i (integer variable) float a[l0](array of 10 real nos) int (*f())() void *f int (*f()) [] void *f int f[] [] [] char *(*f) () int (*f[]) [] float(*f) [] [] float **f int ******f
What standard functions are available to manipulate strings?
What is return in c programming?
What is array in C