<code> HTML Tag

In this article I will discuss the code tag of HTML.
  • 2702

The code tag of HTML is used for indicating a piece of code, or we can say that the code tag defines a piece of computer code.

Example1

<html>

<head>

    <title></title>

</head>

<body>

    <p>

        To create a new array, type the following:<br>

        <code>int[] array_name=new int[5]; </code>

    </p>

    <p>

        To create the new list, type the following:<br>

        <code>list&lt;int&gt; lt1=new list&lt;lint&gt;(); </code>

    </p>

</body>

</html>

 

Output

To create a new array, type the following:
int[] array_name=new int[5];

To create the new list, type the following:
list<int> lt1=new list<lint>();

Example2

<html>

<head>

    <title></title>

</head>

<body>

   <table border=2 ,style="width: 479px">

   <caption>Names and Their creation codes</caption>

   <tr><th>Name</th><th>Code</th></tr>

   <tr><td>Array</td><td><code>int[] ar=new int[10];</code></td></tr>

   <tr><td>LinkedList</td><td><code>LinkedList&lt;int&gt; lt=new LinkedList&lt;int&gt;(); </code></td></tr>

   <tr><td>Stack</td><td><code>Stack&lt;int&gt; stack=new Stack&lt;int&gt;();</code></td></tr>

   </table>

</body>

</html>


Output

 

Names and Their creation codes
Name Code
Array int[] ar=new int[10];
LinkedList LinkedList<int> lt=new LinkedList<int>();
Stack Stack<int> stack=new Stack<int>();

 

Ask Your Question 
 
Got a programming related question? You may want to post your question here
 
© 2020 DotNetHeaven. All rights reserved.