javascript - Arithmetic equations in alert? -
this question has answer here:
hello making alert shows addition of number(num1) + number(num2) in alert box comes user inputted , result wondering how code show whole equation, example, "2 + 2 = 4" if user put in 2 , 2.
i know how show result how can make show numbers user put in result?
assuming understand want do:
a = prompt('first number'); b = prompt('second number'); alert( + '+' + b + '=' + (parseint(a)+parseint(b)));
Comments
Post a Comment