1 Develop JavaScript program with HTML for performing arithmetic operation by taking input from user.

Program:

<html>
    <head>

        <script type="text/JavaScript">

               var a = Number(prompt("Enter any Number:"));  
               var b = Number(prompt("Enter any Number:"));

               document.writeln("A+B:"+(a+b)+"<br/><br/>");
               document.writeln("A-B:"+(a-b)+"<br/><br/>");
               document.writeln("A/B:"+(a/b)+"<br/><br/>");
               document.writeln("A*B:"+(a*b)+"<br/><br/>");
 
        </script>

    </head>

</html>

Output:
JavaScript Arithmetic Operation

Previous
Next Post »