Answers for "how to find factorial in c#"

C#
0

how to find factorial in c#

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);    
     }  
  }
Posted by: Guest on May-03-2021

Code answers related to "how to find factorial in c#"

C# Answers by Framework

Browse Popular Code Answers by Language