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
Can variables be declared anywhere in c?
Write a simple code fragment that will check if a number is positive or negative.
What functions are used for dynamic memory allocation in c language?
I need testPalindrome and removeSpace
#include
What is the code for 3 questions and answer check in VisualBasic.Net?
What is "Hungarian Notation"?
What does. int *x[](); means ?
Is register a keyword in c?
How do shell structures work?
Explain what is wrong with this statement? Myname = ?robin?;
What are the advantages of c preprocessor?
write a c programming using command line argument,demonstrate set operation(eg;union,intersection,difference) example output is c:>setop 12 34 45 1 union 34 42 66 c:>setop 12 34 1 42 66 c:>setop 12 34 diff 12 56 67 78 setop 12 34
What is pragma c?
A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference
When should a far pointer be used?