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


Please Help Members By Posting Answers For Below Questions

What is the difference between a pointer and a link in c ++?

658


Do you know the use of vtable?

743


What is the difference between delegation and implemented-in-terms-of?

632


What is the latest version on c++?

773


Define 'std'.

717






Is c++ a pure oop language?

699


Differentiate between a constructor and a method in C++.

641


Write about c++ storage classes?

870


What is the most useful programming language?

693


What is array give example?

674


What is a forward referencing and when should it be used?

673


Am pass the 10000 records to target in target I will take commit interval 15000 when I was stop the work flow what will happened

1238


What number of digits that can be accuratly stored in a float (based on the IEEE Standard 754)? a) 6 b) 38 c) An unlimited number

907


What is double in c++?

660


Explain the advantages of using friend classes.

695