NEP CMA

PART -A

PROGRAM 1 PROGRAM 2 PROGRAM 3 PROGRAM 4 PROGRAM 5 PROGRAM 6 PROGRAM 7 PROGRAM 8

PART-B

PROGRAM B1 PROGRAM B2 PROGRAM B3 PROGRAM B4 PROGRAM B5 PROGRAM B6 PROGRAM B7 PROGRAM B8 . . .

7. Write a JavaScript that calculates the squares and cubes of the numbers from 0 to 10 and outputs HTML text that displays the resulting values in an HTML table format.

 
  
 
 
 
  
      <html>
<head>
</head>
<body>
<center>
<table border="1">
<tr><th>number</th><th>square</th><th>cube</th></tr>


<script>

   for(var i=0;i<=10;i++)
   {
   document.write("<tr><td>"+i+"</td><td>"+i*i+"</td><td>"+i*i*i+"</td></tr>");
   }
   </script>
 </table>
</center>
</body>
</html>