public
class
FIBONACCI
{
public static void Main()
{
int oldNumber
= 1;
int currentNumber
= 1;
int nextNumber;
System.Console.Write(currentNumber + " ");
while (currentNumber
< 50)
{
System.Console.Write(currentNumber + " ");
nextNumber = currentNumber + oldNumber;
oldNumber = currentNumber;
currentNumber = nextNumber;
}
}
}
No comments:
Post a Comment