what is the different between if-else and switch statment
(other than syntax)
Answer Posted / ananth kumar
switch has its own pros and cons,
Favours coding style.
From performance point, switch case creates table. It
directly jumps to the required location based on table
contents.
If-else is hard for code-walk
Optimised (please check).
Is This Answer Correct ? | 44 Yes | 21 No |
Post New Answer View All Answers
Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?
Explain how do you declare an array that will hold more than 64kb of data?
How can a number be converted to a string?
Explain null pointer.
What is a pointer and how it is initialized?
What is the difference between char array and char pointer?
write a program to create a sparse matrix using dynamic memory allocation.
Can a variable be both const and volatile?
What is ponter?
largest Of three Number using without if condition?
Does * p ++ increment p or what it points to?
What does the message "automatic aggregate intialization is an ansi feature" mean?
What do header files do?
How will you print TATA alone from TATA POWER using string copy and concate commands in C?
Is stack a keyword in c?