Answers

2015-06-12T11:08:34+05:30

This Is a Certified Answer

×
Certified answers contain reliable, trustworthy information vouched for by a hand-picked team of experts. Brainly has millions of high quality answers, all of them carefully moderated by our most trusted community members, but certified answers are the finest of the finest.
class Fibonacci
{
void main()
{
System.out.println("*****Fibonacci Series*****");
int f1, f2=0, f3=1;
System.out.print(f2);
for(int i=1;i<=20;i++)
{
System.out.print(" "+f3+" ");
    f1 = f2;
   f2 = f3;
   f3 = f1 + f2;
}
}
}
1 4 1
2015-06-15T22:09:43+05:30
//TO PRINT FIBNACCI SERIES UPTO 20 TERMS
class Fibonacci
{
void main()

System.out.println("*****Fibonacci Series*****"); 
int f1, f2=0, f3=1;
System.out.print(f2);
for(int i=1;i<=20;i++)

System.out.print(" "+f3+" ");
    f1 = f2; 
   f2 = f3;
   f3 = f1 + f2;
} end of for
} end of main()
}end of class
0