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 / vignesh1988i

as for as me is concerned switch is faster....

in if-else first it will check the if condition , if it is
true it's no problem.. but if it falls false, it will go
to the else part ...

but in switch case , the argument given inside switch
statement will see and automatically to the necessary case
of it... so by comaring the time constraint ,switch saves
the time for checking each else statement for every if....


thank u

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is it valid to address one element beyond the end of an array?

1231


What are the advantages and disadvantages of c language?

1075


What are the keywords in c?

1177


What is 2c dna?

1133


What are different types of operators?

1102


How arrays can be passed to a user defined function

1072


What is return in c programming?

1028


What does & mean in scanf?

1169


any function have arguments one or more OR not . it is compulsary a) any function compulsary have one or more arguments b) any function did not have arguments. It is not compulsary c) it is optional it is not compulsary d) none of the above

1193


How to set file pointer to beginning c?

1253


Can the size of an array be declared at runtime?

1152


How many types of sorting are there in c?

1117


What does 3 mean in texting?

1171


What does d mean?

1173


What is void main () in c?

1256