Write the program for fibonacci in c++?
Answer Posted / darren chang
int fib(int input)
{
if(input==0)
return 0;
if((input==1)||(input==2))
return 1;
else
return fib(input-1)+fib(input-2);
}
Is This Answer Correct ? | 10 Yes | 31 No |
Post New Answer View All Answers
Which is not a valid keyword a) public b) protected c) guarded
What is endl?
How is modularity introduced in C++?
Is c# written in c++?
Why do we need constructors in c++?
What does count ++ do in c++?
What is abstraction in c++ with example?
What are the benefits of pointers?
What does n mean in c++?
What is this pointer in c++?
What is flush programming?
What language is a dll written in?
Where is atoi defined?
How does java differ from c and c++?
Which programming language is best to learn first?