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...

In the following control structure which is faster?
1.Switch
2.If-else
and which consumes more memory?

Answer Posted / abhradeep chatterjee

According to me, switch is faster. cause in nested if-
else, the checking occurs in each step. So, more the
compiler checks, the more it takes time. So switch case is
faster.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is register a keyword in c?

993


What is boolean in c?

1032


What is a const pointer in c?

1073


What is the difference between declaring a variable and defining a variable?

1184


What is wrong with this program statement? void = 10;

1203


Is c call by value?

966


can we have joblib in a proc ?

2228


Does * p ++ increment p or what it points to?

1054


Explain the difference between exit() and _exit() function?

1107


Explain continue keyword in c

961


What is the difference between struct and typedef struct in c?

1082


What is the difference between int main and void main?

997


main() { struct s1 { char *str; struct s1 *ptr; }; static struct s1 arr[] = { {"Hyderabad",arr+1}, {"Bangalore",arr+2}, {"Delhi",arr} }; struct s1 *p[3]; int i; < BR> for(i=0;i<=2;i++) p[i] = arr[i].ptr; printf("%s ",(*p)->str); printf("%s ",(++*p)->str); printf("%s ",((*p)++)->str); }

1358


What is "Duff's Device"?

1111


Does c have an equivalent to pascals with statement?

958