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 = FirstNumberFact(firstNumber) / SecondNumberFact(secondNumber);
- Console.WriteLine($"{division:F2}");
- }
- static decimal FirstNumberFact(decimal firstNum)
- {
- if (firstNum == 1)
- {
- return 1;
- }
- else
- {
- return firstNum * FirstNumberFact(firstNum - 1);
- }
- }
- static decimal SecondNumberFact(decimal secondNum)
- {
- if (secondNum == 1)
- {
- return 1;
- }
- else
- {
- return secondNum * SecondNumberFact(secondNum - 1);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement