squares,roots,cubes and complements of integer-page(1)



 NEXT>>

CODE:


<DOCTYPE! html>
<html>

<head>
</head>

<body>

<table id="table" border="5px">
<tr>
<td>n
</td>
<td>square
</td>
<td>cube
</td>
<td>squareroot
</td>
<td>complement
</td>
</tr>
</table>

<script>

var  i ;

for( i= 1;i<=100;i++)
{              
    var tr=document.createElement("tr");
    var td1=document.createElement("td");
    var td2=document.createElement("td");
    var td3=document.createElement("td");
    var td4=document.createElement("td");
    var td5=document.createElement("td");
   
    td1.innerHTML=i;
    td2.innerHTML=i*i;
    td3.innerHTML=i*i*i;
    td4.innerHTML=Math.round(Math.sqrt(i));
    td5.innerHTML=-i;
    tr.appendChild(td1);
    tr.appendChild(td2);

NEXT>>

No comments:

Post a Comment