For Advertisements on this blog Contact Us at developgram@gmail.com or +91-9923438816

Simple Programming Tutorials For Beginners

Tuesday, April 18, 2017

Smallest Number

<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>





No comments:

Post a Comment

SEARCH THIS BLOG