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


Please Help Members By Posting Answers For Below Questions

What is string constants?

668


What are the advantages of the functions?

613


what is the difference between north western polytechnique university and your applied colleges?? please give ur answers for this. :)

1936


what is recursion in C

620


What is far pointer in c?

817






write a programe to accept any two number and check the following condition using goto state ment.if a>b,print a & find whether it is even or odd and then print.and a

1458


When should the volatile modifier be used?

690


How many bytes are occupied by near, far and huge pointers (dos)?

681


What is the best organizational structure?

648


Is malloc memset faster than calloc?

626


List some applications of c programming language?

563


What is putchar() function?

642


What do you mean by dynamic memory allocation in c? What functions are used?

662


Can we access array using pointer in c language?

651


Explain union.

641