domingo, 11 de octubre de 2009

Practica 6.1 Consola



using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Practica_6_1_Consola
{
class Program
{
static void Main(string[] args)
{
double N, Factor = 1.0, I;
Console.WriteLine("Introduce un numero para calcular factorial");
N = double.Parse(Console.ReadLine());
for (I = N; I >= 1; I--)
{
Factor = Factor * I;
}
Console.WriteLine("El factorial es: {0}", Factor);
Console.ReadKey();
}
}
}

No hay comentarios:

Publicar un comentario