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

Why use of template is better than a base class?

1256


Where can I run c++ program?

1112


how to access grid view row?

2284


What are the two types of comments, and how do they differ?

1211


If a header file is included twice by mistake in the program, will it give any error?

1111


What is vector string in c++?

1136


Is c++ pass by reference or value?

1124


Explain the operation of overloading of an assignment operator.

1229


What does floor mean in c++?

1115


What is a stack? How it can be implemented?

1230


Explain virtual class?

1081


What is the sequence of destruction of local objects?

1023


What is the purpose of extern storage specifier?

1256


What is meant by const_cast?

1180


What are associate containers?

1099