Answer:
Following are the JavaScript program
< html >
< body >
< script >
var k,t; // variable declaration
for (k = 1; i < 6; k++) // iterating the loop
{
t=k*k*k;// find the cube of number
document.write(k); // display the cube root
document.write(" < / br > " ); // moves to the next line
}
< / script >
< / body >
< / html >
Output:
1
8
27
64
125
Step-by-step explanation:
- We used the script tag for creating the JavaScript program.
- Declared the variable "k" in the script tag.
- Iterating the for loop .In the for loop the k variable is initialized by the 1 This loop is executed less then 6 .
- In each iteration we find the cube of number in the "t" variable and display that number by using document .write ().