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
What the advantages of using Unions?
Is that possible to add pointers to each other?
"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above
Explain the Difference between the New and Malloc keyword.
Explain how can I avoid the abort, retry, fail messages?
develop algorithms to add polynomials (i) in one variable
What is meant by recursion?
What are comments and how do you insert it in a C program?
how should functions be apportioned among source files?
Differentiate between ordinary variable and pointer in c.
what are the facialities provided by you after the selection of the student.
Do variables need to be initialized?
What is a structural principle?
What does %2f mean in c?
Write a c program to build a heap method using Pointer to function and pointer to structure ?