Fibonacci

3.3

3 votes
Problem

Aakash Singh, standing at the Frustoo Chowk with a Rose in his hand is plucking leaf petals (Missing his girlfriend a lot). He plucks all the petals of a layer in one go. You have to tell how many petals he will pluck while plucking the 'n'th layer.

(HINT: Count of rose petals is a series of fibonacci numbers)

INPUT: n

OUTPUT: nth Fibonacci Number

Time Limit: 5
Memory Limit: 256
Source Limit:
Explanation

Fibonacci Series : 1,1,2,3,5,8...

Editor Image

?