class fib
{
public static void main(String args[])
{
int a=0,b=1,c=0,i=1;
while(i<=10)
{
System.out.print(C+"");
a=b;
b=c;
c=a+b;
i++;
}
}
}
OUTPUT:1 1 2 3 5 8 13 21 34
Friday, September 26, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment