using System;
namespace Fibonaccinumber
{
class Program
{
static void Main(string[] args)
{
int a=0; // assigning initaial value for first varible
int b=1; // assigning initaial value for second varible
int c=1; // assigning initaial value for third varible
Console.WriteLine(a);
Console.WriteLine(b);
while (true)
{
c = a + b;
if (c >= 200)
{
break;
}
Console.WriteLine(c);
a = b;
b = c;
}
Console.ReadLine();
}
}
}
Output :
Tags:
csharp.net