There seems to be a problem with the smallest bit I have to enter the follwing numbers in this order 89;44;20 a
This outputs 44 as the smallest if I change the order 20;44;89 then it outputs 20.
Are you sure about that ? I don't think so. It works fine for me.
And most importantly all the outputs have to be one under the other I tried adding <br> and <p> tags but this dose not work.
Try "\n".
<html>
<head>
<script type="text/javascript">
var firstnumber = prompt("Enter first number and Click OK", "0");
var secondnumber = prompt("Enter second number and Click Ok", "0");
var thirdnumber = prompt("Enter third number and Click Ok", "0");
var total = Math.floor(firstnumber)+ Math.floor(secondnumber)+ Math.floor(thirdnumber);
var average= (Math.floor(firstnumber)+ Math.floor(secondnumber)+ Math.floor(thirdnumber))/3;
var largest = Math.max(firstnumber, secondnumber, thirdnumber);
var smallest = Math.min(firstnumber, secondnumber, thirdnumber);
alert("Sum: " + total + "\n Average: " + average + "\n smallest:" + smallest + "\n largest: " + largest +"\n")
</script>
</head>
<body>
</body>
</html>