Title: Fibonacci Series
Fibonacci numbers are
0 1 1 2 3 5 8 13 21 ………..
Program:
n=int(input("Enter n value\n"))
a=0
b=1
print(a)
print(b)
c=a+b
while(c<=n):
print(c)
a=b
b=c
c=a+b
Output:
Enter n value
100
0
1
1
2
3
5
8
13
21
34
55
89
Comments
Post a Comment