javascript
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.
6 years ago
10
Answer(0)
other Questions(10)
- BagODonuts
- MHA 618 Discussions
- MAT 116 1A ALGEBRA ALL ASSIGNMENTS A++ DETAILED EXPLANATIONS AND COMPLETE SOLUTIONS USING EQUATION EDITOR (NO MYMATHLAB)
- An Organization Using Creativity and Innovation as a Leadership Strategy
- Nadler Tushman Outputs for Palm, Inc (attached file)
- Assignment Instructions Ethics, Values, and Social Responsibility Ethics has been broadly defined as concerning certain issues or situations as being fair/unfair, right/wrong, or just/unjust according to the values adopted by a given culture or society. T
- Explain how can we figure out the energy of an individual photon by simply measuring the stopping potential
- URGENT: Managing Innovation Assignment No.2
- TheBaron Basketball Company (BBC) earned $10 a share last year and paid a dividend of $6 a share. Next year, you expect BBC to earn $11 and continue its payout ratio. Assume that you expect to sell the stock for $132 a year from now
- the book is THE ADVENTURES OF IBN BATTUTA Chapter 4 "Mecca" (pages 65-79)