Fibonacci Series Using C#(CSharp)

Following program generates the Fibonacci series up to 200.

using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication1
{
class Program
{       
static void Main(string[] args)
{
int number1, number2;
number1 = 0;
number2 = 1;

Console.WriteLine("{0}", number1);
while (number2 < 200)
{
Console.WriteLine("{0}", number2);
number2 = number2 + number1;
number1 = number2 - number1;
}

Console.ReadLine();

}
}
}

Output

Fibonacci Series

0 comments:

Post a Comment

 

About Me

It's Me!Hi, I'm Moinuddin. I'm a Software Engineer at WIPRO working on Microsoft .NET Technology. I'm interested in a wide range of technology topics, mainly Microsoft including Windows Azure, WCF, WPF, Silverlight and any other cool technology that catches the eye.

Site Info

ProjectCSharp.com is mainly about demonstrating real time examples in different technologies like ASP.NET, WCF, WPF, Silverlight, Azure etc..,

Followers

Help Links

Project CSharp (C#) Copyright © 2011. All Rights Reserved.