Skip to content

Instantly share code, notes, and snippets.

@emanoelbarreiros
Created December 2, 2025 11:09
Show Gist options
  • Select an option

  • Save emanoelbarreiros/e9e70a579d9ad860597f74fba4ac1fad to your computer and use it in GitHub Desktop.

Select an option

Save emanoelbarreiros/e9e70a579d9ad860597f74fba4ac1fad to your computer and use it in GitHub Desktop.
Fibonacci recursivo
public class Fibonacci {
public static int fib(int n) {
if (n <= 1) {
return n;
} else {
return fib(n - 1) + fib(n - 2);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment