what is the different between if-else and switch statment
(other than syntax)

Answer Posted / chandra

in switch case we can tell the compiler that you can go
based on user choice
where as in if-else we can test the initial cond then we can
deside

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do we print only part of a string in c?

587


i have to apply for the rbi for the post of officers. i need to know abt the entrance questions whether it may be aps or techinical....

1525


What is string function c?

568


C program to find all possible outcomes of a dice?

1856


What is external variable in c?

614






Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.

3692


What is difference between union All statement and Union?

628


Explain the binary height balanced tree?

727


How can I read and write comma-delimited text?

621


What is volatile variable in c with example?

588


What will be the outcome of the following conditional statement if the value of variable s is 10?

768


Why do we need volatile in c?

749


Write a program in "C" to calculate the root of a quadratic equation ax^2+bx+c=0, where the value of a,b & c are known.

1728


What is meant by realloc()?

679


What is structure in c explain with example?

640