Answers for "multiply function javascript"

1

javascript how to multiply numbers

<!-- Multiplying two numbers in HTML and Javascript -->

<main>
<label for="firstNum">Number 1:</label>
<input type="number" id="firstNum" name="firstNum">

<label for="secondNum">Number 2:</label>
<input type="number" id="secondNum" name="secondNum"></br></br>

<button onclick="multiply()">Multiply</button></br></br>

<label for="result">Result</label>
<input type="number" id="result" name="result"/>
</main>

<script>
function multiply(){
	num1 = document.getElementById("firstNum").value;
	num2 = document.getElementById("secondNum").value;
	result = num1 * num2;
	document.getElementById("result").value = result;
}
</script>
Posted by: Guest on November-17-2020
0

multiply function javascript

// MULTIPLY FUNCTION
const multiply = (num1, num2) => {
  return num1 * num2;
};
let resulMultiply = multiply(4, 5);
console.log(resulMultiply);
// 20
Posted by: Guest on June-09-2020
0

multiply js

const multiply = (x,y)=>{
if(x==1){ return y;}
else if(x>1){
return y +multiply(x-1,y)
}
else throw "Not Numbers"
}
var result = multiply(4,3);
console.log(result)
Posted by: Guest on March-06-2021
0

multiply function javascript

<body>
<p id = "demo"></p>
<script>
       var x = multiply(6, 8)
       dcument.getElementById("demo").innerHTML = x;
       function multiply(a, b)
       {
       return (a * b)
       }
</script>
</body>
Posted by: Guest on October-08-2021

Code answers related to "multiply function javascript"

Browse Popular Code Answers by Language