class Program
{
static void Main(string[] args)
{
int num, a = 1, b = 1, c = 1, d = 0, i;
Console.WriteLine("Enter the
number");
num = int.Parse(Console.ReadLine());
Console.Write(a + " ");
Console.Write(b + " ");
Console.Write(c + " ");
for (i = 3; i < num; i++)
{
d = a + b + c;
Console.Write(d + " ");
a = b;
b = c;
c = d;
}
Console.WriteLine();
Console.ReadLine();
}
}
No comments:
Post a Comment