I wanted to display this: Enter your numbers: 1st : 2nd : Answer : I tried doing this:
var a = prompt("A : ", "");
var b = prompt("B : ", "");
function calc(a,b)
{
return a + b;
}
alert ("The addition is =" + calc(a,b);
I wanted to display this: Enter your numbers: 1st : 2nd : Answer : I tried doing this:
var a = prompt("A : ", "");
var b = prompt("B : ", "");
function calc(a,b)
{
return a + b;
}
alert ("The addition is =" + calc(a,b);
To do it with only one prompt: