JAVASCRIPT PROGRAM TO TAKE THREE NUMBERS AS INPUT FROM THE USER,FIND THE MINIMUM AND MAXIMUM ,PRINT THE OUTPUT IN BOLD

<html>
<body>
<script language="javascript">
var a,b,c,max,min;
max=0;
min=999;
a=prompt("Enter  first number:");
b=prompt("Enter  second number:");
c=prompt("Enter  third number:");

if (a > max)
{
   max=a
}
 if (b > max)
{
   max=b
}  
if (c > max)
{
   max=c
}  
if (a < min)
{
   min=a
}
 if (b < min)
{
   min=b
}  
if (c < min)
{
   min=c
}  
document.write("<b>"+"maximum:"+max+"</b>"+"<br>");
document.write("<b>"+"minimum:"+min+"</b>"+"<br>");
</script>
</body>
</html>

No comments:

Post a Comment