Advertisement
Iskrenov84

08. Factorial Division

Feb 10th, 2022
779
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.65 KB | None | 0 0
  1. using System;
  2.  
  3. namespace P8._FactorialDivision
  4. {
  5.     internal class Program
  6.     {
  7.        
  8.  
  9.         static void Main(string[] args)
  10.         {
  11.             double numberOne = double.Parse(Console.ReadLine());
  12.             double numberTwo = double.Parse(Console.ReadLine());
  13.             double resultOne = 1;
  14.             double resultTwo = 1;
  15.             for (double i = numberOne; i > 0; i--)
  16.             {
  17.                 resultOne *= i;
  18.             }
  19.             for (double i = numberTwo; i > 0; i--)
  20.             {
  21.                 resultTwo *= i;
  22.             }
  23.             Console.WriteLine($"{resultOne / resultTwo:f2}");
  24.         }
  25.     }
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement