Fibonacci Number
Easyjavapythonccppjavascript
Find the N-th Fibonacci number. The sequence starts 0, 1, 1, 2, 3, 5, ... (0-indexed: F(0) = 0, F(1) = 1).
Input Format
A single line containing the integer N.
Output Format
Print F(N).
Example 1
Input
7
Output
13
Explanation: The sequence is 0, 1, 1, 2, 3, 5, 8, 13.
- 0 <= N <= 40
Submit an attempt to unlock the solution. (Sign in first.)
Related Problems
- Factorial Using RecursionEasy · java, python, c, cpp, javascriptSolve Problem
- Power Using RecursionEasy · java, python, c, cpp, javascriptSolve Problem
- Generate All SubsetsMedium · java, python, c, cpp, javascriptSolve Problem