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 / vignesh1988i

here the return function will give an error message or it
will only take the first function (ie) fibbo(n-1) since
after return this is the first recursive function
called.... so this altast return 1 to the main program....
that's all.... as for as i know this will be the
procedure...... and then the "or" must not be used .. only
logicalOR must be used ||.........

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What the advantages of using Unions?

667


Is that possible to add pointers to each other?

892


"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above

605


Explain the Difference between the New and Malloc keyword.

680


Explain how can I avoid the abort, retry, fail messages?

583






develop algorithms to add polynomials (i) in one variable

1731


What is meant by recursion?

625


What are comments and how do you insert it in a C program?

735


how should functions be apportioned among source files?

622


Differentiate between ordinary variable and pointer in c.

611


what are the facialities provided by you after the selection of the student.

1650


Do variables need to be initialized?

616


What is a structural principle?

634


What does %2f mean in c?

672


Write a c program to build a heap method using Pointer to function and pointer to structure ?

4169