Hi,
The program for the following question can be written in Python or Java. Please explain the logic as comments in the program just to make sure you have done it. The response has to be submitted by 9pm Thursday (7th May 2020) in the form of a comment to this post. The question is as follows:
Design a program to input 2 numbers in separate inputs and display a fibonacci list starting from the 2 numbers. The list should contain total 10 numbers.
Sample:
Input 1: 1
Input 2: 3
Output: 1,3,4,7,11,18,29,47,76, 123
Enjoy!
Happy coding!
Regards,
Team LeisureDown
Hi LeisureDown,
This is the Python Code
#Python first=int(input("enter the first integer number"))
second=int(input("enter the second integer number"))
fibonacci_list=[]
sum=0
fibonacci_list.append(first)
fibonacci_list.append(second)
for i in range(8):
sum=first+second
first,second=second,sum
fibonacci_list.append(sum)
print("the fibonacci series is:",fibonacci_list)