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.  Write a JavaScript program that asks the user for a number 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. from 1 to 50 and then prints out the powers of 2,

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

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!