using System;
class Program
{
public static void Main()
{
int factor;
Console.WriteLine("Enter a number");
int number = int.Parse(Console.ReadLine());
factor = number;
for (int i = number - 1; i >= 1; i--)
{
factor = factor * i;
}
Console.WriteLine(factor);
}
}
class Program
{
public static void Main()
{
int factor;
Console.WriteLine("Enter a number");
int number = int.Parse(Console.ReadLine());
factor = number;
for (int i = number - 1; i >= 1; i--)
{
factor = factor * i;
}
Console.WriteLine(factor);
}
}
No comments:
Post a Comment