You are developing an interactive application that continuously accepts user input until the user decides to exit. Which loop construct would be most appropriate for this scenario?

  • do-while loop
  • for loop
  • switch statement
  • while loop
The most appropriate loop construct for an interactive application that accepts user input until the user decides to exit is a 'while loop.' It allows continuous input acceptance while checking an exit condition.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *