Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

fibonacci series using recursion

def fibonacci(n):
    if n <= 1:
          return n
    else:
        return fibonacci(n - 1) + fibonacci(n - 2)

n = int(input())
result = fibonacci(n)
print(result)
Source by learning.ccbp.in #
 
PREVIOUS NEXT
Tagged: #fibonacci #series #recursion
ADD COMMENT
Topic
Name
4+5 =