0
I am new to coding but I tried something was there any other easy and small way for it. https://code.sololearn.com/W8sSXS9oAw6x/
https://code.sololearn.com/W8sSXS9oAw6x/?ref=app
8 Respostas
+ 1
Paste it instead of your js
+ 1
Maybe you want something like this
alert("write the number whose table you want to learn");
alert("do not leave it blank nothing will come")
var z = prompt ("enter number");
for(let i=1;i<=10;i++){
let y = (z*10);
document.write(`${z}×${i}=${y}<br>`)
}
+ 1
Thanks a lot
0
Please tell
0
Please tell
0
It is in which section of sololearn js or html or any other please tell
0
But I didn't understand it
0
It is a loop it will loop from 1 to 10 and each time will multiply z with the number.
For the document.write when you use `` you can pass variables inside if you put the variable inside ${} so it will print z × i = y
Where z is the number the user entered, i is changing each time starting from 1 until 10, y is z*i