Page 151 - Computer Software Application TP - Volume 1
P. 151
COMPUTER SOFTWARE APPLICATION - CITS
<script>
for (let i = 0; i < 10; i++)
{
if (i % 2 === 0)
{
console.log(i, “is even”);
}
else
{
console.log(i, “is odd”);
}
}
</script>
</body>
</html>
3 Save the program as a .html file
4 Open the html file with a web browser
5 Go to the browsers console tab and verify the output.
TASK 8 : Using for loop and - Iterate through properties of an object
1 Open the text editor
2 Write the following codes
html >
<head>
<title> for loop </title>
136
CITS : IT & ITES - Computer Software Application - Exercise 39