using System;
public class exam
{
public static void Main()
{
int f,f1,f2,i,n;
f1=-1;
f2=1;
Console.Write("Enter the Number : ");
n = int.Parse(Console.ReadLine());
for(i=0;i<n;i++)
{
f = f1+f2;
Console.WriteLine("\n"+f);
f1 = f2;
f2 = f;
}
}
}C#
Looping Statement : for Statement

Written by
View ProfileSenthilvelan Sambamoorthy
Senthilvelan Sambamoorthy is working as a Professor in Department of Master of Computer Applications, Paavai Engineering College, Namakkal, Tamilnadu, India, He is Masters in Computers Applications. Having 18+ years of experience and his area of interest is Java, JSP, Servlet, J2EE, C#, PHP, Python ASP.NET, SQL Server and etc.
