Question: Write a while loop that prints user_num divided by 2 until user_num is less than 1. The value of user_num changes inside of the loop.
Write a while loop that prints user_num divided by 2 until user_num is less than 1. The value of user_num changes inside of the loop. Sample output for the given program: 10.0 5.0 2.5 1.25 0.625 Note: These activities may test code with different test values. This activity will perform four tests, with user_num = 20, then with user_num = 1, then with user_num = 0, then with user_num = -1. See How to Use zyBooks. Also note: If the submitted code has an infinite loop, the system will stop running the code after a few seconds, and report "Program end never reached." The system doesn't print the test case that caused the reported message.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
