daily pastebin goal
17%
SHARE
TWEET

Untitled

a guest Feb 22nd, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace _08FactorialDivision
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             decimal firstNumber = decimal.Parse(Console.ReadLine());
  10.             decimal secondNumber = decimal.Parse(Console.ReadLine());
  11.  
  12.             decimal division = Fact(firstNumber) / Fact(secondNumber);
  13.  
  14.             Console.WriteLine($"{division:F2}");
  15.         }
  16.  
  17.         static decimal Fact(decimal num)
  18.         {
  19.             if (num == 1)
  20.             {
  21.                 return 1;
  22.             }
  23.             else
  24.             {
  25.                 return num * Fact(num - 1);
  26.             }
  27.         }
  28.     }
  29. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top