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 are local static variables? How can you use them?

1151


I was asked to write a program in c which when executed displays how many no.of clients are connected to the server.

2372


Is r written in c?

1162


What is an identifier?

1036


What is integer constants?

1082


Define VARIABLE?

1169


program to find out date after adding 31 days to a date in the month of febraury also consider the leap year

3095


What is enumerated data type in c?

1085


What was noalias and what ever happened to it?

1048


Draw a diagram showing how the operating system relates to users, application programs, and the computer hardware ?

2580


Define Spanning-Tree Protocol (STP)

1135


Devise a program that inputs a 3 digit number n and finds out whether the number is prime or not. Find out its factors.

1126


What is a rvalue?

1204


What is calloc()?

1074


What is the ANSI C Standard?

1271