Question: Write a JavaScript program that asks the user for a number from 1 to 50 and then prints out the powers of 2, from 1
Write a JavaScript program that asks the user for a number from 1 to 50 and then prints out the powers of 2, from 1 to the user input. Use a for loop to generate the output. Here is a sample display. Note that there is a heading and a display of the original user input.
You can have some fun with the display if you want, like using a list or a table. Notice that the text in the top row are centered, and the values below are right justified. 
A Table Showing Powers of You entered: 8 n 2n 0 16 5 32 6 64 1128 8 256
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
