Java with Android Updates
Knowledge Can Impact our Dreams
MY mENU
Home
I-Quest
Code
T-ips
T-Minds
TechWords
Refer
Index
Thursday, 17 January 2013
Fibonacci Series in Java
class Fibonacci
{
public static void main(String[] args)
{
int prev,next,sum,n;
prev=next=1;
sum=0;
for(n=1;n<=10;n++)
{
System.out.println(prev);
sum=prev+next;
prev=next;
next=sum;
}
}
}
No comments:
Post a Comment
Newer Post
Older Post
Home
No comments:
Post a Comment