Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solve(firstNum, secondNum) {
  2.  
  3.     function calculateFacotiral(num) {
  4.         let factorial = 1;
  5.        
  6.         for (let i = 1; i <= num; i++) {
  7.             factorial *= i;            
  8.         }
  9.  
  10.         return factorial;
  11.     }
  12.  
  13.     console.log((calculateFacotiral(firstNum) /calculateFacotiral(secondNum)).toFixed(2));
  14.    
  15. }
  16.  
  17. solve(5, 2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement