#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

Post New Answer

More Engineering AllOther Interview Questions

what is LINUX?

5 Answers  


. 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?

3 Answers   TCS,


Friends Any one tell me the best institute for the telecom protocol course

0 Answers  


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.

1 Answers  


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.

0 Answers  






i want questions only on code part like general logics in c and java

0 Answers  


How to select the total numbers of fire extinguisher installed in a room ?

0 Answers  


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

0 Answers  


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?

3 Answers   IBM, L&T,


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)

2 Answers   Infosys,


describe how your code can determine if the user entered an input box value or click the cancel button?

0 Answers  


how 2 write a program of this pattern usin for loop?? 1 2 3 4 5 6 7 8 9 10

0 Answers  


Categories
  • Civil Engineering Interview Questions Civil Engineering (5085)
  • Mechanical Engineering Interview Questions Mechanical Engineering (4451)
  • Electrical Engineering Interview Questions Electrical Engineering (16632)
  • Electronics Communications Interview Questions Electronics Communications (3918)
  • Chemical Engineering Interview Questions Chemical Engineering (1095)
  • Aeronautical Engineering Interview Questions Aeronautical Engineering (239)
  • Bio Engineering Interview Questions Bio Engineering (96)
  • Metallurgy Interview Questions Metallurgy (361)
  • Industrial Engineering Interview Questions Industrial Engineering (259)
  • Instrumentation Interview Questions Instrumentation (3014)
  • Automobile Engineering Interview Questions Automobile Engineering (332)
  • Mechatronics Engineering Interview Questions Mechatronics Engineering (97)
  • Marine Engineering Interview Questions Marine Engineering (124)
  • Power Plant Engineering Interview Questions Power Plant Engineering (172)
  • Textile Engineering Interview Questions Textile Engineering (575)
  • Production Engineering Interview Questions Production Engineering (25)
  • Satellite Systems Engineering Interview Questions Satellite Systems Engineering (106)
  • Engineering AllOther Interview Questions Engineering AllOther (1379)