TheBulgarianWolf

Big Factorial

Jan 2nd, 2021
641
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.53 KB | None | 0 0
  1. using System;
  2. using System.Numerics;
  3.  
  4. namespace BigFactorial
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             Console.WriteLine("Enter your number here(1-1000): ");
  11.             int number = int.Parse(Console.ReadLine());
  12.  
  13.             BigInteger bigInteger = 1;
  14.             for(int i = number; i > 0; i--)
  15.             {
  16.                 bigInteger *= i;
  17.             }
  18.  
  19.             Console.WriteLine("The factorial is: ");
  20.             Console.WriteLine(bigInteger);
  21.         }
  22.     }
  23. }
  24.  
Add Comment
Please, Sign In to add comment