Question: Write a JavaScript to do the following: 1. Prompt the user (see note below) to ask for a single digit number. You can assume the

Write a JavaScript to do the following: 1. Prompt the user (see note below) to ask for a single digit number. You can assume the user will enter a valid value 2. Write a for loop that will iterate from 1 to 100. 3. For each iteration, check to see if the current number is divisible by the number given by the user. 4. If it is, display the number to the console. Sample Output: User enters 6 6 12 18 24 ... Note: You can prompt the user for a number using the following code: let num = +prompt('Enter a number'); The prompt function will ask the user for input. The plus before it will convert the response to a number

Write a JavaScript to do the following: 1. Prompt the user (see

Write a JavaScript to do the following: 1. Prompt the user (see note below) to ask for a single digit number. You can assume the user will enter a valid value 2. Write a for loop that will iterate from 1 to 100. 3. For each iteration, check to see if the current number is divisible by the number given by the user. 4. If it is, display the number to the console. Sample Output: User enters 6 6 12 18 24 Note: You can prompt the user for a number using the following code: let num = +prompt('Enter a number'); The prompt function will ask the user for input. The plus before it will convert the response to a number

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!