Drawing Flowchart for function calculate a number in the Fibonacci Series

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);
}
}
``````
-
Is the call to fibonacci() not just a process/function symbol - no need for a special "I'm recursive function" symbol? – Andrew Jan 13 '13 at 11:37
PS: I appreciate that the formatting here may not be your fault, but please be consistent on your use of braces and indentation - eg your `for` loop is not indented, some `{` opening braces are trailing others not (etc) – Andrew Jan 13 '13 at 11:40
Why are you trying to make a flowchart? We used those when we programmed in assembly language. They don't help when programming in any higher level language. – kevin cline Jul 31 '13 at 2:55
FYI, the runtime performance of the recursive Fibonacci implementation is beyond awful. – whatsisname Jul 31 '13 at 3:25
There are two kinds of flowcharts: (1) control-flow chart, which is the traditional understanding, and (2) value-dependency chart, which is sometimes called dataflow diagram. The computation of Fibonacci numbers is a often-mentioned example in which the two approaches would predict a different order of complexity given the chart. – rwong Jul 31 '13 at 7:38

We should create flow chart before writing code to depict the flow. It should be simple enough to understand and has to be language agnositic. Here is flowchart that I created for fibonacci series.

-

The flowchart you have published is correct. You don't need to change anything. Only one comment: these dotted lines are really excessive, they are merely additional explanation, and it seems to me that it is because of them that you thought you have problems.

-