/******************************************************/ /* Introduction to Programming */ /* By Dr. ANTF */ /* www.antf.net */ /* Copyright 2015 */ /* */ /* C# 317 - Problem 16: Factorial */ /******************************************************/ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DOS { class Program { static void Main(string[] args) { int n, mul = 1; Console.Write("Please enter a number: "); n = int.Parse(Console.ReadLine()); for (int i = 1; i <= n; i++) mul = mul * i; Console.WriteLine("\n{0}! = {1}", n, mul); Console.ReadKey(); } } }