Drawing Flowchart for function calculate a number in the Fibonacci Series
Posted
by
truongvan
on Programmers
See other posts from Programmers
or by truongvan
Published on 2013-01-13T11:13:35Z
Indexed on
2013/07/01
10:29 UTC
Read the original article
Hit count: 315
I'm trying make Flowchart for function calculate a number in the Fibonacci Series. But It looks like not right. I don't how draw the recursive function. Please help me how to fix it.
My flowchart: DIA
This is my code:
#include <iostream>
using namespace std;
long long Fibonacci(int input);
int main()
{
cout << "Input Fibonacci Index number: ";
int Index = 0;
cin >> Index;
cout << Fibonacci(i) << endl;
return 0;
}
long long Fibonacci(int input)
{
if (input < 2)
return input;
else
{
return Fibonacci(input - 1) + Fibonacci(input - 2);
}
}
© Programmers or respective owner