#include<stdio.h>
int fn(int v);
main()
{
printf("%d\n",fn(7));
}
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;
}
No Answer is Posted For this Question
Be the First to Post Answer
what is LINUX?
. There are two water tanks A and B, A is much smaller than B. While water fills at the rate of 1 liter every hour in A, it gets filled up like, 10, 20, 40,80, 160…..in tank B. (At the end of first hour, B has 10 liters, second hour it has 20 liters and so on). If tank B is 1/32 filled of the 21 hours, what is total duration of hours required to fill it completely?
Friends Any one tell me the best institute for the telecom protocol course
Given a passport size photo draw vertical and horizontal lines and mark the intersection points(assume one for the photo and zero for the background).Give the intersection points(1 or 0) to program and print "." for input 1.
what size shaft is required to transmit 100 hp @1000 RPM ,if max shear stress is 10,000 PSI,angle of twist must be less than 1' /ft/shaft is made of steel.
i want questions only on code part like general logics in c and java
How to select the total numbers of fire extinguisher installed in a room ?
HOW WE CAN CORRELATE THE MA\ECHANICAL POWER TO ELECTRICAL POWER. SUPPOSE IF I WANT A PUMP OF PUMPIG 200 LPM AT 20 METER HEAD MENAS WHAT IS THE POWER NEEDED FOR PUMP IN ELECTRCAL AND HOW CAN WE GET IT
Bird is flying 120 km/hr between B to R. Two trains at B to R at 60 kmph. The distance traveled by the bird before it is killed?
Write a function that responds to a click anywhere on the page by displaying an alert dialog. Display the event name if the user held Shift during the mouse click. Display the element name that triggered the event if the user held Ctrl during the mouse click. (Answer in Java Language)
describe how your code can determine if the user entered an input box value or click the cancel button?
how 2 write a program of this pattern usin for loop?? 1 2 3 4 5 6 7 8 9 10