Answer to Question #287342 in Python for Rox

Question #287342

For every program, there should be a softcopy file containing (i) Algorithm/Flowchart, (ii)

Source Code, (iii) Output

Q.2.Write a program to display the first n terms of Fibonacci series.


1
Expert's answer
2022-01-14T04:36:28-0500


N = int(input("Enter No. of terms of fibonacci series: "))
a = 0
b = 1
print("Terms of Fibonacci Series:")
print("Term-1 = %d"%a)
print("Term-2 = %d"%b)
for r in range(2,N):
    c = a+b
    a=b
    b=c
    print("Term-%2d = %d"%(r+1,c))


Flow Chart






Output






Pseudo Code

Pseudo code (Fibonacci Series)

-        Get the no. of terms of Fibonacci Series (N)

-        First Term a=0

-        Second Term b = 1

-        Initialize a for loop from n=2 to N

-        Get the next term c = a+b

-        Update a = b        and b = c

-        If n < N, repeat the above step

-        Diplay Fibonacci Series



Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS