Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript multiplication without operator

function Multiply(Num1, Num2) {

        if(Num1 == 1)
        { return Num2;}
        else if(Num1 > 1){
        return Num2 + Multiply(Num1 -1 , Num2)
        }
        else throw "Not a number"
    }
        var result = Multiply(15,3);
        console.log(result)
 
PREVIOUS NEXT
Tagged: #javascript #multiplication #operator
ADD COMMENT
Topic
Name
9+6 =