Tech Study

Write a HTML program to print the squares of the numbers 1 to 10 number

Square of numbers from 1 to 20. 

This is a relatively easier problem. The first approach that comes to mind is running a loop and traversing the integers from 1 to 20. And for every integer “I”, calculate the value of i*I and print it. But HTML is not a programming language and therefore has no syntax for creating loops. And therefore we have to print the value of squares from 1 to 20 manually. 

NOTE: For using loops or any logical operations on numbers, we can use javascript along with HTML to execute.

CODE :

<!DOCTYPE html>

<html>

   <head>

        

      <meta charset="utf-8">

        

      <title>www.techstudy.org</title>

   </head>

   <body>

      1<sup>2</sup> = 1

      <br />

      2<sup>2</sup> = 4

      <br />

      3<sup>2</sup> = 9

      <br />

      4<sup>2</sup> = 16

      <br />

      5<sup>2</sup> = 25

      <br />

      6<sup>2</sup> = 36

      <br />

      7<sup>2</sup> = 49

      <br />

      8<sup>2</sup> = 64

      <br />

      9<sup>2</sup> = 81

      <br />

      10<sup>2</sup> = 100

      </br>

      11<sup>2</sup> = 121

      <br />

      12<sup>2</sup> = 144

      <br />

      13<sup>2</sup> = 169

      <br />

      14<sup>2</sup> = 196

      </br>

      15<sup>2</sup> = 225

      <br />

      16<sup>2</sup> = 256

      <br />

      17<sup>2</sup> = 289

      <br />

      18<sup>2</sup> = 324

      <br />

      19<sup>2</sup> = 361

      <br />

      20<sup>2</sup> = 400

   </body>

</html>

</html>

Expected OUTPUT :


1^2=1

2^2=4

3^2=9

4^2=16

5^2=25

6^2=36

7^2=49

8^2=74

9^2=81

10^2=100

11^2=121

12^2=144

13^2=169

14^2=196

15^2=225

16^2=256

17^2=289

18^2=324

19^2=361

20^2=400

TaggedWrite a HTML program to print the squares of the numbers 1 to 10 number

Java Final keyword

Introduction : java final keyword The final keyword present in Java programming language is generally used for restricting the user. …

Read more

C++ Memory Management: new and delete

C++ Memory Management We know that arrays store contiguous and the same type of memory blocks, so memory is allocated …

Read more