what is the different between if-else and switch statment
(other than syntax)
Answer Posted / fazlur rahaman naik
The main difference between switch - case and if - else is
we can't compare variables.
in the if - else, first the condition is verified,then it
comes to else whereas in the switch - case first it checks
the cases and then it switches to that particular case.
| Is This Answer Correct ? | 168 Yes | 35 No |
Post New Answer View All Answers
What should malloc() do?
What is the difference between the local variable and global variable in c?
Explain which function in c can be used to append a string to another string?
Create a structure to specify data on students given below: Roll number, Name, Department, Course, Year of joining Assume that there are not more than 450 students in the college. 1.write a function to print names of all students who joined in a particular year 2.write a function to print the data of a student whose roll number is given
What is pass by reference in functions?
Write a program to generate random numbers in c?
Are comments included during the compilation stage and placed in the EXE file as well?
Can a variable be both static and volatile in c?
How can I pad a string to a known length?
Multiply an Integer Number by 2 Without Using Multiplication Operator
Explain the use of fflush() function?
Is c is a procedural language?
Who is the founder of c language?
write a program that declares an array of 30 elements named "income" in the main functions. then cal and pass the array to a programmer-defined function named "getIncome" within the "getIncome" function, ask the user for annual income of 30 employees. then calculate and print total income on the screen using the following function: "void getIncome ( ai []);
What are integer variable, floating-point variable and character variable?