employer cover photo
employer logo
employer logo

General Dynamics Mission Systems

Employeur impliqué

Question d’entretien chez General Dynamics Mission Systems

Write a method to return the nth entry in the Fibonacci sequence.

Réponse à la question d'entretien

Utilisateur anonyme

5 juil. 2019

int fib(int n) { if(n <= 0) { return 0; } if(n == 1) { return 1; } return fib(n - 1) + fib(n - 2) }