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 are the 4 types of organizational structures?
What is infinite loop?
Write a program to swap two numbers without using third variable?
Explain the red-black trees?
Explain what is page thrashing?
What are the features of c language?
What are operators in c?
What is difference between constant pointer and constant variable?
How many levels of pointers can you have?
Explain what is output redirection?
What is getch c?
How do we open a binary file in Read/Write mode in C?
What is %d called in c?
What is the best way to comment out a section of code that contains comments?
Is it possible to use curly brackets ({}) to enclose single line code in c program?