Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

i want explaination about the program and its stack reprasetaion

fibbo(int n)
{
if(n==1 or n==0)
return n;
else
return fibbo(n-1)+fibbo(n-2);
}
main()
{
fibbo(6);
}

Answer Posted / abdur rab

#include <stdio.h>

int fibonacci ( int nNumber )
{
if ( ( nNumber == 0 ) || ( nNumber == 1 ) ) return
( nNumber );
return fibonacci ( nNumber -1 ) + fibonacci (
nNumber - 2 ) ;
}


int main ( int argc, char* argv[] )
{
printf ( "\n The Fibnoci value :%d", fibonacci (
5 ) );
return ( 1 );


Other than the logical or, everyting is perfect, the
function will recursivel bubble down and for this value it
ud become like this if u copy this to a notepad, with
formating, it ud be easy to understand

4 +
3

3 + 2
2 + 1

2 + 1 1 + 0
1 + 0 ( will return 1 )

1 + 0 ( all others will return 1 )

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what is the difference between the expression '++a' and 'a++'?

1267


What is the purpose of void pointer?

1106


Explain what does the characters 'r' and 'w' mean when writing programs that will make use of files?

1313


What are the header files used in c language?

1099


Which programming language is best for getting job 2020?

1104


What is conio h in c?

1096


What is the use of f in c?

1034


Is exit(status) truly equivalent to returning the same status from main?

1123


What is realloc in c?

1169


Why pointers are used?

1120


What is unsigned int in c?

1058


What are the similarities between c and c++?

1141


A collection of functions,calls,subroutines or other data a) library b) header files c) set of files d) textfiles

1238


What's the total generic pointer type?

1109


hi, which software companys will take,if d candidate's % is jst 55%?

2140