Advertisement
teofarov13

Untitled

Feb 5th, 2023
802
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function factorial(n1, n2) {
  2.     let result = 1;
  3.     let result1 = 1;
  4.     for (let i = 1; i <= n1; i++) {
  5.         result *= i;
  6.     }
  7.     for (let i = 1; i <= n2; i++) {
  8.         result1 *= i;
  9.     }
  10.     let total = result / result1
  11.     console.log(total.toFixed(2));
  12. }
  13. factorial(5,
  14.     2
  15. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement