Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _08FactorialDivision
- {
- class Program
- {
- static void Main(string[] args)
- {
- decimal firstNumber = decimal.Parse(Console.ReadLine());
- decimal secondNumber = decimal.Parse(Console.ReadLine());
- decimal division = Fact(firstNumber) / Fact(secondNumber);
- Console.WriteLine($"{division:F2}");
- }
- static decimal Fact(decimal num)
- {
- if (num == 1)
- {
- return 1;
- }
- else
- {
- return num * Fact(num - 1);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement