Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / mathiyazhagan

Though both are Braching statements,The selection of
statement is depending on developers.for simple
comparisions,there is no need to SWITCH statement.switch
statement will not use to compare floating,String and
logical expressions.
we can also use switch statement to somple
comparisons ,though it not fair as following segments :
switch(a>b)
{
case 0 :
max=a;
break;
case 1 :
max=b;
break;
}
I want to conclude that if...else structure is more
flexible and reliable than switch statement.

Is This Answer Correct ?    29 Yes 25 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a volatile keyword in c?

1163


Explain how can you be sure that a program follows the ansi c standard?

1473


Is it fine to write void main () or main () in c?

1025


What is chain pointer in c?

1058


What is define c?

1072


What is static and volatile in c?

1221


write a program in c language to print your bio-data on the screen by using functions.

6787


Explain main function in c?

1082


What is #ifdef ? What is its application?

1106


Can a pointer point to null?

1063


c programs are converted into machine language with the help of a) an interpreter b) a compiler c) an operatinf system d) none of the above

1256


What is #line in c?

1014


What are void pointers in c?

995


When should the register modifier be used? Does it really help?

963


What are structural members?

1007