You're working on a program that continuously monitors sensor data and reacts when a certain threshold is reached. Which loop construct would be most suitable for this task?

  • do-while loop
  • for loop
  • if-else statement
  • while loop
The most suitable loop construct for continuously monitoring sensor data is a 'while loop.' A while loop checks a condition and executes its code block repeatedly as long as the condition is true. This allows continuous monitoring until the threshold is reached.
Add your answer
Loading...

Leave a comment

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