Javascript Program 01.
Addition,Substraction,Multiplication,Division and Remainder of two numbers,which were accepted from user.
<!doctype html>
<html>
<head>
<title>JavaScript Program</title>
</head>
<body>
<script type="text/javascript">
var n1,n2,a,s,m,d,r;
n1=parseInt(prompt("Enter First Number"));
n2=parseInt(prompt("Enter Second Number"));
a=(n1+n2);
document.write("Addition="+a+"<br>");
s=(n1-n2);
document.write("Subtraction="+s+"<br>");
m=(n1*n2);
document.write("Multiplication="+m+"<br>");
d=n1/n2;
document.write("Division="+d+"<br>");
r=(n1%n2);
document.write("Remainder="+d+"<br>");
</script>
</body></html>
Output-
Addition=8
Subtraction=0
Multiplication=16
Division=1
Remainder=1
Please Comment and Share. ConversionConversion EmoticonEmoticon