How does the goto statement alter the flow of control in a C++ program? 

  • It repeats the loop indefinitely. 
  • It skips to the next iteration of a loop. 
  • It transfers control to a labeled statement in the code. 
  • It exits the program immediately.
The goto statement in C++ provides an unconditional jump from the goto to a labeled statement found elsewhere in the code. Although it allows for more flexibility in controlling the flow, its overuse or misuse can make the code less readable and more prone to errors. The modern programming paradigm usually discourages its use.
Add your answer
Loading...

Leave a comment

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