Wednesday, 30 October 2013

Fibonacci Series in C#

using System;

using System.Collections.Generic;

using System.Text;


namespace Fib

{

   class Fib

   {

      static void Main(string[] args)

      {
  int f0=0,f1=1,fact;
  int n= Convert.ToInt16(Console.ReadLine());
 
  Console.WriteLine("Fibonacci numbers" +f0);
  Console.WriteLine("Fibonacci numbers" +f1);

   for(int i=1;i<=n;i++)
{
 fact=f0+f1;
 f0=f1;
 f1=fact;
Console.WriteLine("Fibonacci numbers" +fact);
   }
Console.ReadLine();
}
}}

2 comments:

  1. good one

    http://jobstelangana.in/general-awareness-questions-and-answers/

    ReplyDelete
  2. http://www.kidsfront.com/ find the right stuff about academics on this site

    ReplyDelete