Java modifying to a do/while loop

Code with C | Programming: Projects & Source Codes Forums JAVA Programming Java modifying to a do/while loop

This topic contains 1 reply, has 1 voice, and was last updated by  ShikhaTan 2 years, 6 months ago.

  • Author
    Posts
  • #10914

    Maxim6m0cj
    Member

    Here’s the code I was provided with and I want to know how to change this into a do/while loop.

  • #10915

    ShikhaTan
    Member

    I’m not sure if you understand what you are asking, but here you go:

    You don't need a do/while loop here, a while loop or your current loop would work just fine. A do/while loop is a loop that executes ONCE no matter if the condition is false or true. In your case, your while condition will remain true for quite a time.

You must be logged in to reply to this topic.