#C14656. Fibonacci Number
Fibonacci Number
Fibonacci Number
The Fibonacci sequence is defined recursively as follows:
\(F(0) = 0,\) \(F(1) = 1,\) and for all \(n \ge 2\), \(F(n) = F(n-1) + F(n-2)\).
Your task is to compute the \(n\)th Fibonacci number using an efficient iterative approach. Please note that the input will be a single non-negative integer and you should output the corresponding Fibonacci number.
inputFormat
The input consists of a single line containing a non-negative integer (n).
outputFormat
Output the (n)th Fibonacci number.## sample
0
0