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
show how link list can be used to repersent the following polynomial i) 5x+2
How would you obtain the current time and difference between two times?
What does *p++ do?
what is the c source code for the below output? 5555555555 4444 4444 333 333 22 22 1 1 22 22 333 333 4444 4444 5555555555
What is a 'null pointer assignment' error?
Write the program that calculates and prints the average of several integers. Assume that the last value read is sentinel 9999.
void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }
What are pointers?
What does the file stdio.h contain?
swap 2 numbers without using third variable?
What is the role of this pointer?
What is operator promotion?
What is meant by errors and debugging?
What is wild pointer in c?
What are c identifiers?