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


Please Help Members By Posting Answers For Below Questions

Write a function expand(s1,s2) that expands shorthand notations like a-z in the string s1 into the equivalent complete list abc...xyz in s2 . Allow for letters of either case and digits, and be prepared to handle cases like a-b-c and a-z0-9 and -a-z. z-a:zyx......ba -1-6-:-123456- 1-9-1:123456789987654321 a-R-L:a-R...L a-b-c:abbc

5053


What is strcpy() function?

653


How many keywords are there in c?

586


What does return 1 means in c?

580


Why is c called "mother" language?

855






Describe how arrays can be passed to a user defined function

776


Why do we use pointer to pointer in c?

593


What is union and structure in c?

612


If i have an array 0 to 99 i.e,(Size 100) I place the values 1 to 100 randomly like a[0]=29,a[1]=56 upto array[99].. the values are only between 1 to 100. getting the array values by using scanf.. If i entered one wrong element value line a[56]=108. how can i find it.. and also how to find the missing value in 1 to 100.. and i want to replace the missing values.. any one of them know please post your answer..

1587


Can a void pointer point to a function?

565


while initialization of array why we use a[][2] why not a[2][]...?

1862


What is #include in c?

596


What are the types of data structures in c?

596


Is c++ based on c?

646


Difference between Function to pointer and pointer to function

625