To accept a number between 1-10 and display the fibonic series Class 11 computer science plz don't scam
Answers
Answered by
18
[Following còdes are written in python]
Required program :-
n = int(input("How many numbers do you want in fibonacci series: "))
num1 = 0
num2 = 1
for i in range(n):
print(num1)
k = num1
num1 = num2
num2 = k + num2
See the attachment for output
---------------------------------------------
Fibonacci series : It is the series of numbers starting from 0, 1 where the next number obtained is the sum of its previous two terms.
i.e.
0, 1, 1, 2, 3, 5, 8, 13, 21, . . . .
---------------------------------------------
[Don't còpy and pàste this program to run, I have entered some blank spaces to render correct ìndentations, either the program will throw an error. ]
Attachments:
Similar questions