#include <iostream>
using namespace std;
long long Fibanocci(int nth);
int main()
{
long long * piNum = new long long;
cout << "Please enter what term you would like from the Fibanocci series (warnign! High numeber (even 50) can overheat your computer): ";
cin >> *piNum;
cout << "\nYour value is: " << Fibanocci(*piNum) << endl;
cin.get();
return 0;
}
long long Fibanocci(int nth)
{
long long temp = 0;
if (nth < 4) return 1;
temp = (Fibanocci(nth-2) + Fibanocci(nth -1));
return temp;
}
Copyright © 2024, NextGenUpdate.
All Rights Reserved.