From 4364b5a75968ac59b11b18ac2ee6ef308d6007ab Mon Sep 17 00:00:00 2001 From: amitdudhankar <72137523+amitdudhankar@users.noreply.github.com> Date: Thu, 13 Oct 2022 21:41:57 +0530 Subject: [PATCH] Create Factorial Code in C# This code will help students and newbie coders to understand the Factorial of the number --- Factorial Code in C# | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Factorial Code in C# diff --git a/Factorial Code in C# b/Factorial Code in C# new file mode 100644 index 00000000..e399f92f --- /dev/null +++ b/Factorial Code in C# @@ -0,0 +1,16 @@ +This code will help students and newbie coders to understand the Factorial of the number + +using System; + public class FactorialExample + { + public static void Main(string[] args) + { + int i,fact=1,number; + Console.Write("Enter any Number: "); + number= int.Parse(Console.ReadLine()); + for(i=1;i<=number;i++){ + fact=fact*i; + } + Console.Write("Factorial of " +number+" is: "+fact); + } + }