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

What happens if a pointer is deleted twice?

1276


When does a name clash occur in c++?

1173


Differentiate between a template class and class template in c++?

1101


What is conditions when using boolean operators?

1237


Declare a class vehicle and make it an abstract data type.

970


What is the this pointer?

1122


Explain the concept of copy constructor?

1052


Why do we need pointers?

1008


Write a short code using c++ to print out all odd number from 1 to 100 using a for loop

1029


Write about the role of c++ in the tradeoff of safety vs. Usability?

1073


Explain how functions are classified in C++ ?

1236


What are the advantages of using a pointer?

1082


Describe new operator?

1163


Explain linked list using c++ with an example?

1086


What data structure is fastest, on average, for retrieving data: a) Binary Tree b) Hash Table c) Stack

1084