Advertisement
EntropyStarRover

6 multiplication

Feb 25th, 2019
124
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function multiply(input){
  2.     let num=input.shift();
  3.  
  4.     let firstDig=Number(num.charAt(0));
  5.  
  6.     let secondDig=Number(num.charAt(1));
  7.  
  8.     let thirdDig=Number(num.charAt(2));
  9.  
  10.  
  11.  
  12.     for (let i=1; i<=thirdDig;i++){
  13.         for (let j=1; j<=secondDig; j++){
  14.             for (let k=1; k<=firstDig; k++){
  15.            
  16.                 console.log(`${i} * ${j} * ${k} = ${i*j*k}`);
  17.             }
  18.         }
  19.     }
  20. }
Advertisement
RAW Paste Data Copied
Advertisement