Write the program for Fibonacci series (ten terms only)
1 2 3 5 8 13 21......
Answers
Answered by
0
Answer:
You should specify the programming language but I am writing wrt python
n = int(input("Enter the value of 'n': "))
a = 0
b = 1
sum = 0
count = 1
print("Fibonacci Series: ", end = " ")
while(count <= n):
print(sum, end = " ")
count += 1
a = b
b = sum
sum = a + b
You have to enter 10 when the interpreter asks.
Hope it helps
Mark as brainliest.
Similar questions