What is the potential problem with the following loop: while(true) { /* code */ }? 

  • It will cause a compile-time error. 
  • It can potentially result in an infinite loop. 
  • The code inside will never execute. 
  • It will slow down the computer significantly.
The loop while(true) will continue to execute indefinitely since the condition is always true. This can potentially lead to an infinite loop, consuming CPU resources, and making the program unresponsive unless externally interrupted.
Add your answer
Loading...

Leave a comment

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