write a program to print first 15 terms of fibonacci series 011235813 with.. the output
Answers
Answered by
4
Answer:
public class Fibonacci
{
public static void main(String args[])
{
int a=0,b=1,c=0,n=3;
System.out.println("The Fibonacci Series is");
System.out.pintln(a);
System.out.println(b);
do
{
c=a+b;
System.out.println(c);
a=b;
b=c;
n++;
}
while(n<=10);
}
}
Output
The Fibonacci series is
0
1
1
2
3
5
8
13
21
34
55
89
144
233
377
Similar questions