Fibonacci sequence · Compiler
Fibonacci sequence
Compute the Fibonacci number at index n. The sequence starts with F(0) = 0 and F(1) = 1. For n >= 2, F(n) = F(n - 1) + F(n - 2).
- Input
- One integer n (0 <= n <= 45).
- Output
- Print F(n) as a decimal integer.
Compiler Explorer runs your code when you run or check it.
Loading your exercise draft…