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

write a program for the normal snake games find in most of the mobiles.

2214


Tell me what is null pointer in c?

1013


Why can’t we compare structures?

1226


What is class and object in c?

1047


4-Take two sets of 5 numbers from user in two arrays. Sort array 1 in ascending and array 2 in descending order. Perform sorting by passing array to a function mySort(array, sortingOrder). Then multiply both the arrays returned from function, using metric multiplication technique in main. Print result in metric format.

2137


What are disadvantages of C language.

1101


Do you know the difference between exit() and _exit() function in c?

1014


Does c have an equivalent to pascals with statement?

959


write a c program to calculate sum of digits till it reduces to a single digit using recursion

3245


Explain a pre-processor and its advantages.

1073


What is the use of define in c?

1001


How can a string be converted to a number?

965


Explain how do you determine whether to use a stream function or a low-level function?

1026


Can true be a variable name in c?

986


List some applications of c programming language?

901