From a3d26d7fcc87e834bf0fa8522b69feb957813376 Mon Sep 17 00:00:00 2001 From: khojianvar Date: Tue, 28 Mar 2023 19:26:26 +0500 Subject: [PATCH] Task7 --- Task/Task/Program.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Task/Task/Program.cs b/Task/Task/Program.cs index a2ce029..77cee94 100644 --- a/Task/Task/Program.cs +++ b/Task/Task/Program.cs @@ -4,7 +4,16 @@ internal class Program { static void Main(string[] args) { - Console.WriteLine("Hello, World!"); + Console.Write("Enter the number: "); + int num = int.Parse(Console.ReadLine()); + int factorial = 1; + int new_num = num; + for (; num != 0;) + { + factorial *= num; + num -= 1; + } + Console.WriteLine($"Factorial of {new_num} is: {factorial}"); } } } \ No newline at end of file