Skip to content

Commit bef49ea

Browse files
shifting
1 parent 8c15fb9 commit bef49ea

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#code of the program
2+
#fibonacci series
3+
4+
n=int(input("No. of terms :-" ))
5+
6+
#1st two terms are predefined
7+
a1=0
8+
a2=1
9+
i=0
10+
11+
#applying conditions for correct results
12+
if n<=0:
13+
print("Enter the terms > 0 ")
14+
elif n==1:
15+
print(a1)
16+
else:
17+
18+
#using loops
19+
print("FIBONACCI SERIES :-") #generating the series
20+
while i<=n:
21+
print(a1)
22+
a=a1+a2
23+
a1=a2
24+
a2=a
25+
i+=1
26+

0 commit comments

Comments
 (0)