Question: Write a while loop that multiplies userNum by 2 while userNum is less than 50, displaying the result after each multiplication. Ex: For userNum =

Write a while loop that multiplies userNum by 2 while userNum is less than 50, displaying the result after each multiplication. Ex: For userNum = 4, output is: 8 16 32 64 (with each value output on a separate line) need what to put for code exactly. Write a while loop that multiplies userNum by 2 while userNum is

\begin{tabular}{l|l} CHALLENGE & 4.5.1: LoOps. \end{tabular} 451044.2588926.q3zqy7 Jump to level 1 Write a while loop that multiplies userNum by 2 while userNum is less than 50 , displaying the result after each multiplication. Ex: For userNum =4, output is: 8163264 (with each value output on a separate line) \begin{tabular}{l|l} 1 & let userNum =4;// Code will be tested with values: 4,10 and 60 \\ 2 & var ans =";; \\ 3 & while(userNum+=4; \\ 5 & ans += userNum +" "; \\ 6 & console. log( ans ); \\ 7 & con \\ 8 & \end{tabular}

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!