1.
Write a program to create a menu driven program
To print the fibbonacii series upto n terms
i.e 0,1,1,2,3,5,.....n terms in java
Answers
Answered by
2
Answer:
java program to generate Fibonacci nos.
1. public class Fibonacci
2. int n, a=0,b=0,c=1;
3. scanner s =new scanner (system).
4. system.out.print ( enter value of n:");
5.n= s.nextlnt();
6. system out print ("Fibonacci series:");
7. for (int i = 1; i < = n;i++)
8. a = b;
9. b = c;
10. c = a+b;
11. system out print(a+" ");
__________________________
Hope it's helpful for you
Similar questions