PROGRAM TO GENERATE FIBONACCI SERIES – JAVA

//PROGRAM TO GENERATE FIBONACCI SERIES
class Fibonacci
{
public static void main(String ar[])
{
int a=0,b=1,n=10,c=0;
System.out.print(a+” “+b);
for(int i=1;i<n-1;i++)
{
c=a+b;
a=b;
b=c;
System.out.print(” “+c);
}
}
}

Leave a Reply

Your email address will not be published. Required fields are marked *