In the following control structure which is faster?
1.Switch
2.If-else
and which consumes more memory?
Answer Posted / battini.laxman
switch is faster because when in nested if condition has to
check for each time. where as in switch it diectly check
only labels.
| Is This Answer Correct ? | 8 Yes | 1 No |
Post New Answer View All Answers
Explain what are the __date__ and __time__ preprocessor commands?
What is header file in c?
Why flag is used in c?
Explain what are global variables and explain how do you declare them?
In a switch statement, what will happen if a break statement is omitted?
What is meant by realloc()?
What is the easiest sorting method to use?
What is action and transformation in spark?
What are the complete rules for header file searching?
List some of the static data structures in C?
Is Exception handling possible in c language?
What is auto keyword in c?
Program will then find the largest of three numbers using nested if-else statements. User is prompted to enter three numbers. Program will find the largest number and display it on the screen. All three numbers entered by the user are also displayed. If user enters 21, 33, and 5, the output should be as follows: You entered: 21, 33 and 5. The largest number is 33.
What is the difference between arrays and pointers?
Between macros and functions,which is better to use and why?