Alexisss’s Weblog
Just another WordPress.com weblog

Factorial

class Program
{
static void Main(string[] args)
{
int b = 1, i, a = 0, c = 0;
Console.WriteLine(”dame un numero”);
int n = int.Parse(Console.ReadLine());

for (i =n; n > 1 ; i–)
{
a = n * (n – 1);
c = b * a;
b = c;
n = n – 2;

}
Console.WriteLine(”el numero factorial es” + b);
string x = Console.ReadLine();
}
}
}

No Responses Yet to “Factorial”

Leave a Reply