Computer Science, asked by sakina7134, 4 months ago

Write the javascript code to enter user defined number using prompt box and print the multiplication table of that number upto 10 using for loop .
NEED ANSWER ASAP
THANK YOU
(pls no scams) :)

Answers

Answered by Sahanja
4

Explanation:

♤ Example 1: Multiplication Table Up to 10

// program to generate a multiplication table // take input from the user let number = parseInt(prompt('Enter an integer: ')); //creating a multiplication table for(let i = 1; i <= 10; i++) { // multiply i with number result = i * number; // display the result console.log(`${number} * ${i} = ${result}`); }

Output

Enter an integer: 3 3 * 1 = 3 3 * 2 = 6 3 * 3 = 9 3 * 4 = 12 3 * 5 = 15 3 * 6 = 18 3 * 7 = 21 3 * 8 = 24 3 * 9 = 27 3 * 10 = 30

In the above program, the user is prompted to enter an integer value. Then, the for loop is used to iterate through 1 to 10 to create a multiplication table.

♤ pls follow me and mark me as brainliest

Similar questions