Fibonacci Numbers

Find the nth number in the Fibonacci sequence.

Statement

Implement a function to find the nth^{th} Fibonacci number in the Fibonacci sequence.

Fibonacci numbers form a sequence known as the Fibonacci sequence, where each number is the sum of two preceding ones, starting from 00 and 11.

The Fibonacci numbers are defined as:

  • F0=0F_0= 0
  • F1=1F_1= 1
  • Fn=Fn1+Fn2F_n= F_{n-1} + F_{n-2}, for n2n \geq 2
...
Access this course and 1400+ top-rated courses and projects.