Question: Write the Java code for a sentinel-controlled loop that asks the user to enter an integer and then prints the square root of the integer
Write the Java code for a sentinel-controlled loop that asks the user to enter an integer and then prints the square root of the integer with 3 decimal places. The loop should continue until the user enters a negative value. Assume input has been declared as a Scanner object.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
