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

Give the rules for variable declaration?

1223


What does calloc stand for?

1245


How do you determine the length of a string value that was stored in a variable?

1174


What is function definition in c?

1120


What's the best way of making my program efficient?

1154


What is the right type to use for boolean values in c? Is there a standard type? Should I use #defines or enums for the true and false values?

1106


What are the disadvantages of c language?

1257


stripos — Find position of first occurrence of a case- insensitive string int stripos ( char* haystack, char* needle, int offset ) Returns the numeric position of the first occurrence of needle in the haystack string. Note that the needle may be a string of one or more characters. If needle is not found, stripos() will return -1. The function should not make use of any C library function calls.

2529


How can I find out if there are characters available for reading?

1167


Can a pointer be volatile in c?

1044


What is the newline escape sequence?

1146


can anyone please tell about the nested interrupts?

2187


Explain how do you determine a file’s attributes?

1093


What language is lisp written in?

1326


Which driver is a pure java driver

1690