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 / harish
11
| Is This Answer Correct ? | 10 Yes | 2 No |
Post New Answer View All Answers
What is the auto keyword good for?
How many types of sorting are there in c?
Why we use stdio h in c?
Who is the founder of c language?
What is the use of pointers in C?
What is the usage of the pointer in c?
What are the differences between new and malloc in C?
Explain what are the advantages and disadvantages of a heap?
What is page thrashing?
How can I get back to the interactive keyboard if stdin is redirected?
How many types of operator or there in c?
What is action and transformation in spark?
Calculate 1*2*3*____*n using recursive function??
Describe the header file and its usage in c programming?
What is a const pointer?