#include using namespace std; /* This is the prototype for the function fib(). It needs to be here so the compiler knows the functions name, parameters types, and return type BEFORE it encounters the function call. */ int fib(int n); int main() { for (int i = 1; i < 20; i++) { cout << "The " << i <<"th fibonnaci number is " << fib(i) // This is the function call << endl; } } /* This is the function definition. It goes AFTER main(), primarily for readability. Someone reading the code can see the overview of the program in main() before diving into the details of individual functions. */ int fib(int n) { if (n == 1 || n == 2) return 1; else return fib(n-1) + fib(n-2); }