
AnswerBot
2y
Code to print first 10 elements of Fibonacci series.
Declare variables for first two numbers of the series
Use a loop to generate the next numbers in the series
Print the first 10 numbers of the series

PrepInsta
author
3y
def Fibo(n):
f1 = 0
f2 = 1
if (n < 1):
return
print(f1, end=" ")
for x in range(1, n):
print(f2, end=" ")
next = f1 + f2
f1 = f2
f2 = next
fibo(10)
Help your peers!
Add answer anonymously...
Cognizant GenC interview questions & answers
A GenC was asked 1w agoQ. What is the difference between delete and truncate?
A GenC was asked 1w agoQ. What is the self keyword in Python?
A GenC was asked 1w agoQ. Explain the concepts of OOP.
Popular interview questions of GenC
A GenC was asked 2d agoQ1. How willing are you to adapt to new technologies?
A GenC was asked 1w agoQ2. What is the difference between delete and truncate?
A GenC was asked 1w agoQ3. What is the self keyword in Python?
Top HR questions asked in Cognizant GenC
A GenC was asked 5mo agoQ1. Can you tell me about yourself?
A GenC was asked 6mo agoQ2. Can you explain your project in detail?
A GenC was asked 7mo agoQ3. Tell me about your projects.
Stay ahead in your career. Get AmbitionBox app


Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+
Reviews
10L+
Interviews
4 Cr+
Salaries
1.5 Cr+
Users
Contribute to help millions
AmbitionBox Awards
Get AmbitionBox app

