← All problemsSign in

Fibonacci

You are given an integer $N$. You need to print the $N^{th}$ Fibonacci number $F_N$. In mathematics, $F_N$ is given by the recurrence relation $F_N = F_{N-1} + F_{N-2}$ with $F_0=0$ and $F_1=1$. The first few Fibonacci numbers are $F_0=0,F_1=1,F_2=1,F_3=2,F_4=3,...$. **Note:-** The constraints for $N$ is large. You might want to consider unsigned long integers for storing your results to avoid ov

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start