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
Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.
One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.
What is type qualifiers?
What is methods in c?
What is static memory allocation?
What is a const pointer?
Is the exit() function same as the return statement? Explain.
What are structure members?
Write a program to know whether the input number is an armstrong number.
What is wrong with this initialization?
What are the two types of structure?
What is void main ()?
What is typeof in c?
Is malloc memset faster than calloc?
Explain the process of converting a Tree into a Binary Tree.