Fibonacci series in C#

Sumank
Posted by Sumank under C# category on | Points: 40 | Views : 1741
class Program
{
static void Main(string[] args)
{
int a = 0;
int b = 1;
int c = 1;
int count = 0;

Console.Write("Enter The Number");
count = Console.Read();
Console.WriteLine("Fibonacci Series :");
Console.Write("{0}", "{1}", a, b);
for (int i = 0; i <= count; i++)
{
c = a + b;
a = b;
b = c;
Console.Write("{0}", c);
}
}
}

Comments or Responses

Login to post response