Wednesday, August 25, 2021

Divide Two Numbers in JavaScript

 A simple program to ask the user to give two numbers and then the program will divide the two numbers and display the results on the screen.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at the following email address for further details.  If you want to advertise on my website, kindly contact me also at my email address also. Thank you.


My email address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360.




Program Listing

<html>

 <head> 

  <title>Divide Two Numbers in JavaScript</title>

 </head>

 <body>

  <h1>Divide Two Numbers in JavaScript</h1>

  <script>

  var a = prompt("Enter First Value");

  var b =prompt("Enter Second Value");


     var divide = parseInt(a) / parseInt(b);


     alert("The quotient of " + a + " and " + b 

           + " is " + divide.toFixed(2) + ".");

    </script>

  </body>

  </html>

No comments:

Post a Comment