# Program to Generate Fibonacci sequence upto a given no of terms:
n=input("Enter the no. of terms of Fibonacci series:")
a=1
b=1
c=0
print("The Fibonacci Series upto",n,"terms is:")
print(a)
print(b)
n=int(n)
for i in range (1,n-1):
c=a+b
a=b
b=c
print (c)
n=input("Enter the no. of terms of Fibonacci series:")
a=1
b=1
c=0
print("The Fibonacci Series upto",n,"terms is:")
print(a)
print(b)
n=int(n)
for i in range (1,n-1):
c=a+b
a=b
b=c
print (c)
Comments
Post a Comment