Computer Science, asked by srivastavabhay607, 5 months ago

Write a menu driven program to accept the number of terms from the user and print the series

according to user choice.

The user is given the following options:

(i) Fibonacci Series –A series which starts from 0 and 1, the subsequent numbers are

sum of the previous two numbers.

0,1,1,2,3,5,8,13,…n terms

(ii) Pell Series –A series which starts from 1 and 2, the subsequent number are the sum

of twice the previous number and the number previous to the previous number.

1 ,2,5,12,29,70,169,408,985,2378,5741,13860...n terms

For an incorrect option, an appropriate error message should be displayed.​
To be done in java program

Answers

Answered by acamateur
1

Answer:

Following is simple program to print first n Fibonacci numbers. fibonacci- sequence ... Input : n = 3 Output : 1 1 2 Input : n = 7 Output : 1 1 2 3 5 8 13 ... int f1 = 0, f2 = 1, i;.

Similar questions