+ 2
i want to get the summation but it concatinate the no so how can i get the sum? var v1=prompt ("enter 1st no"); var v2=prompt ("enter 2nd no"); alert ("Sum="+(v1+v2));
2 odpowiedzi
+ 2
Use the parseInt() function to parse a string into an integer.
var v1 = parseInt(prompt("enter 1st no"));
var v2 = parseInt(prompt("enter 2nd no"));
alert("Sum = " + (v1+v2));
+ 1
very very thanks bhai..😊