adspace


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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Hi i'm richa piplani applied for ATC(IT) if u have the syllabus & old question papers forward me.I will be very much thankful to you. piplani.richa@gmail.com and sonu_pips@yahoo.co.in

2087


how to create user name stape by stape in cisco router {with command}

3186


Please if anybody have Vizag Steel Entrance exam papers or atleast Pattern of exam.Then please forward to my email- id: :srikanth.avanthi@gmail.com

2039


why c is called middle level langauge?

2110


Please send me Sample papers National Informatics Centre (NIC) Programmer. I am giving this paper first time..so if any one have previous question papers send to manoj200.yadav@gmail.com. thnx in advance

2039


If i update, insert or delete records in my view will it affect my base table?????

1837


What is Campus selection process of patni at Adcet,Ashta at 24th dec 2010.Also give apti syllabus.

2507


Hi All... PLease send me if anyone have "Information Security Officer" Aptitude papers. Please Mail me at mannusanghi@gmail.com

1931


Why do you want to work here

1833


why u r shifting from engineering to other field ?

2263


need tcs questn papers from 2007 to 2009 plzzzmail to 9015.rama@gmail.com its urgent

2031


hi , anyone plz end nic model papers to my id

2375


when will the group1&group2 exams will be held

1871


Hi, I am appearing for the ISRO exam for the post of Scientist/ Engineer to be held on 26th April,09. Can anyone help me regarding the same? I want to know about the exam pattern and the syllabus. If anyone could share your experience or sample papers for the same at khadhar786@rediffmail.com? It would be very useful for me. Thanks.

2208


sir, please send me the last three years exam papers conducted by CPCL- RECRUITMENT EXAM FOR Recruitment of Engineer ELECTRICAL ENGINEERING. A Soon as possible. i would be greatfull to u

1959