Computer Science, asked by Zaina043, 1 year ago

Write a program in java to display the first 10 numbers of the fibonacci series 0,1,2,3,.................. .

Answers

Answered by Nawaz0917
14
To display first ten nos. of the Fibonacci series

public class Fibonacci
{
Public static void main(String args[])
{
int a,b,c,n;a=0;b=1;c=0;n=3;
System.out.println( "The Fibonacci series is ");
System.out.println(a);
System.out.println(b);
do
{
c=a+b;
System.out.println(c);
a=b;
b=c;
n=n+1;
}
while(n<=10);
}
}


I Hope it Helps
Similar questions