using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int number, i,factorial=1;
Console.WriteLine("Enter the an integer number");
number =Convert.ToInt32(Console.ReadLine());
for (i = 1; i <= number; i++)
{
factorial = factorial * i;
}
Console.WriteLine("Factorial is");
Console.WriteLine(factorial);
Console.ReadKey();
}
}
}
nyc coding easy to understand 4 new comer
ReplyDelete