1. #include <iostream>
    2. using namespace std;
    3. int GetFibNumber(int fibIndex)
    4. {
    5. if (fibIndex < 2)
    6. {
    7. return fibIndex;
    8. }
    9. else
    10. {
    11. return GetFibNumber(fibIndex - 1) + GetFibNumber(fibIndex - 2);
    12. }
    13. }
    14. int main(){
    15. cout << "Enter number index: ";
    16. double index = 0;
    17. cin >> index;
    18. cout << "Fibonacci number is: " << GetFibNumber(index) << endl;
    19. return 0;
    20. }