#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;
}



#include<stdio.h> int fn(int v); main() { printf("%d\n",fn(7)); } int fn..

Answer / Shalvendra Payal

[ "
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;
}

mainn{
printf("%d
",fn(7))" ]

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Engineering AllOther Interview Questions

write a program to reverse a string using recursive function without using str functions.

1 Answers  


what is routing protocals & routed protocals.

2 Answers   DELL, jetking,


how you judge that your interview go good????

1 Answers   L&T,


What is VAT Account determination ? and how we can map in SAP ?

1 Answers   TCS,


multithreading??

1 Answers  


What would be the difficulties with building a bridge that connects the UK and Canada?

1 Answers  


What do you like and dislike about working for this organisation?

1 Answers   Microsoft,


successful command to make linux system as router in redhat-+

1 Answers  


is a student eligible to sit in the campus selection after getting 55% marks in class 12th.

3 Answers   Infosys,


hi to all,i done ccna,now im looking job,but it is very diffcult to get job in networking field,.........i dnt know what im doing wrongly,kindly help me and give the proper way...i have so much of interest in this field only

1 Answers  


how to print a number in character(ex. 123= one twenty three)?

1 Answers  


What is the difference between "type testing" and "product qualification"?

1 Answers  


Categories
  • Civil Engineering Interview Questions Civil Engineering (5086)
  • Mechanical Engineering Interview Questions Mechanical Engineering (4453)
  • Electrical Engineering Interview Questions Electrical Engineering (16638)
  • 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)