Page 306 - Web Applications (803) Class 11
P. 306
Example:
<HTML>
<BODY>
<SCRIPT>
document.write(Math.round(7.4))
document.write("<br>"+Math.round(7.6))
document.write("<br>"+Math.ceil(3.9))
document.write("<br>"+Math.ceil(3.2))
document.write("<br>"+Math.ceil(-3.2))
document.write("<br>"+Math.floor(5.2))
document.write("<br>"+Math.floor(-5.2))
document.write("<br>"+Math.trunc(8.2))
document.write("<br>"+Math.trunc(-8.2))
</SCRIPT>
</BODY>
</HTML>
Output:
Lab Assignment ‘n Activity Interdisciplinary
Check the output of the following code. Explain the output.
<html>
<body>
<h1>Studying JavaScript</h1>
<script>
document.write("Math.floor(-5.7): " + Math.floor(-5.7))
document.write("<br> Math.ceil(3.4): " + Math.ceil(3.4))
document.write("<br>"+isNaN("Three hundred"))
</script>
</body>
</html>
304 Touchpad Web Applications-XI

