JavaScript Program to Print Square of numbers from 1 to 10

Write a JavaScript program to print square of numbers from 1 to 10.



Source Code
<html>
<head>
	<title>Square of numbers from 1 to 10</title>
</head>
<body>
<script>
  document.write("Number Square");
  for(i = 1; i <= 10; i++)
  {
    document.write("<br> " + i + " -> " + i*i);
  }
</script>
</body>
</html>
Output





"Coding Hub - Learn to code" app now available on Google Play Store