The Fibonacci sequence is a series of numbers where the next number is the addition of the last two numbers, The Fibonacci series starts with 0, and 1.
using System;
class Fibonacci {
public static void Main() {
int n,a=0,b=1,next,i;
Console.Write("Enter the length of series:");
n=int.Parse(Console.ReadLine());
Console.Write(a+"\t"+b);
for(i=2;i<n;i++)
{
next=a+b;
Console.Write("\t"+next);
a=b;
b=next;
}
}
}
Enter the length of series:8 0 1 1 2 3 5 8 13