Untitled

 avatar
unknown
plain_text
2 years ago
411 B
7
Indexable
<!DOCTYPE html>
<html>
<head>
    

<title>For loop that will iterate from 0 to 15</title>
</head>
<body>
    <p id="a"><p>
        
    <script>
  let text="";
  for(let i=0;i<=15;i++)
      {
      if(i%2==0)
      text +="the number is even " + i +"<br>"
      else 
      text += "the given number is odd" + i +"<br>"
      }
      document.getElementById("a").innerHTML=text;
    
</script>
</body>
</html>
Editor is loading...