Computer Science, asked by krishna1491, 1 year ago

what a Java script program to display multiplication table of any number up to 10

Attachments:

Answers

Answered by shraddha33204
3

Multiplication Table

document.write(”);

function multiply() {

var col, row, answer, multiplier; //declare variabels

document.write(‘Multiplication Table’ + ”);

document.write(‘Refresh the browser to use a different table multiplier’ + ”);

multiplier = prompt(“Enter a Multiplication Table max multiplier, ie; 10 for 10×10”, “”)

multiplier = parseInt(multiplier); //parse the num to number

document.write(”); //setup the table

for( col = 1; col <= multiplier; col++) {

document.write('’ + ‘ ‘);

for( row=1; row <= multiplier; row++) {

answer = col * row; //multiply columns * rows, store in variable answer

document.write( '’ + ‘ ‘ + answer + ‘ ‘ + ”);

}

document.write(”);

}

document.write(”);

}

document.write(”);

window.onload = multiply;


Hope it helps u.


krishna1491: can u help me
krishna1491: I can't understand
shraddha33204: how??
krishna1491: please help me. I can't understand how to do
shraddha33204: even idk
shraddha33204: my brother sended me i just mugged up
krishna1491: u can explain how to start a line
shraddha33204: idk
shraddha33204: i am sorry
krishna1491: okk dear thnx
Similar questions