class Fibonacci
{
public static void main(String[] args)
{
int a=0,b=1,s=0;
System.out.println("Fibonacci series printing 10times:"); System.out.println(a);
System.out.println(b);
int i=0;
while(i<10)
{
s=a+b;
a=b;
b=s;
System.out.println(s);
i++;
}
}
}
aDDa For All ===> Free downloads | eBooks | Softwares | SMS | Fun | News | Codes | Techie | Music | Movies
Subscribe to:
Post Comments (Atom)
Output:
ReplyDeleteFibonacci series printing 10times:
0
1
1
2
3
5
8
13
21
34
55
89