Smallest Number

By Developgram - April 18, 2017

<html>
<head>
 <script>
  function FindSmall(n1, n2, n3)
  {
   if (n1 < n2)
    smaller = n1;
   else
    smaller = n2;

   if(smaller < n3)
    smallest  = smaller;
   else
    smallest = n3;

   document.write(smallest + " is smallest number");
  }
 </script>
</head>
 <body>
  <script>
   var num1, num2, num3;

   num1 = parseInt(prompt("Enter the first number"));
   num2 = parseInt(prompt("Enter the second number"));
   num3 = parseInt(prompt("Enter the third number"));

   FindSmall(num1, num2, num3)
  </script>
 </body>
</html>





  • Share:

You Might Also Like

0 comments