<!DOCTYPE html>
<html>
<head>
<title>JavaScript Exercise</title>
<script type="text/javascript">
function exercise(){
var result = "";
result += "Math.round(1.4) = " + Math.round(1.4) + "\n";
result += "Math.round(1.5) = " + Math.round(1.5) + "\n";
result += "Math.ceil(1.5) = " + Math.ceil(1.5) + "\n";
result += "Math.floor(1.5) = " + Math.floor(1.5) + "\n";
alert(result);
}
function htmlonload(){
exercise();
}
</script>
</head>
<body onload="htmlonload();">
JavaScript Exercise
</body>
</html>
Friday, August 5, 2011
Javascript Exercise: Math.round(), Math.round(), Math.ceil() and Math.floor()
example:
Labels:
JavaScript Exercises
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment