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 / rajesh
b
| Is This Answer Correct ? | 8 Yes | 1 No |
Post New Answer View All Answers
List the types of polymorphism in c++?
How do I download c++?
Is c++ a good beginners programming language?
Which operations are permitted on pointers?
What does extern mean in a function declaration in c++?
What is the use of dot in c++?
How does c++ sort work?
What is a type library?
What is abstraction with real time example?
Explain about Virtual Function in C++?
What is a .h file c++?
What is Destructor in C++?
explain the reference variable in c++?
What is the equivalent of Pascal's Real a) unsigned int b) float c) char
What do you understand by zombie objects in c++?