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

Evaluate the following:
int fn(int v)
{
if(v==1 || v==0)
return 1;
if(v%2==0)
return fn(v/2)+2;
else
return fn(v-1)+3;
}
for fn(7);




1) 10


2) 11


3) 1

Answer Posted / vinay

11 because it resrve every value in stack untill it become
1 then add all values.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I invoke another program or command and trap its output?

1100


What is the difference between text and binary modes?

1198


What does %c do in c?

995


What is a spanning Tree?

1597


What is 1f in c?

2666


Explain high-order bytes.

1122


What does the error 'Null Pointer Assignment' mean and what causes this error?

1225


write a program to copy the string using switch case?

2908


Describe explain how arrays can be passed to a user defined function

1109


Explain the bubble sort algorithm.

1078


What is #define?

1121


What is break in c?

1051


How many identifiers are there in c?

1025


Write a program to print “hello world” without using semicolon?

1124


What is string function in c?

990