Wap to print a no according to your age choice upto 20 terms
Answers
Answered by
0
Explanation:
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;
}
}
}
Similar questions