Program to print the Fibonacci series first N term
oll, 2, 3,5,8,13
Answers
Answered by
1
Answer:
import java.util.Scanner;
class fibonacci
{
public static void main(String args[])
{
Scanner ob=new Scanner(System.in);
sopln("enter the value of N");
int N=obj.nextInt();
int a=2,b=3,c=0;
for(int i=1;i<=N;i++)
{
sopln(a):
c=a+b;
a=b;
b=c;
}
}}
Similar questions