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:
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);

a) 10
b) 11
c) 1

Answer Posted / babita sharma

The answer would be
b.

11 Its teh recursive function.

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Describe private, protected and public?

1067


What problems might the following macro bring to the application?

1032


Can char be a number c++?

1033


Write a program for Divide a number with 2 and Print the output ( NOTE: Check for divide by zero error).

1099


Is swift a good first language?

1031


Is facebook written in c++?

984


How do you save a c++ program?

1026


write a porgram in c++ that reads an integer and print the biggest digit in the number

2240


What is runtime polymorphism in c++?

1147


What does catch(…) mean?

1101


what is COPY CONSTRUCTOR and what is it used for?

1062


How many static variables are created if you put one static member into a template class definition?

1020


What is the oldest programming language?

998


Why do we use using namespace std in c++?

1061


What is an inline function in c++?

1100