Which looping construct is best suited when the number of iterations is known beforehand?

  • do-while
  • for
  • switch
  • while
The 'for' loop is commonly used when the number of iterations is known beforehand, as it allows you to specify the initialization, condition, and iteration steps in a compact manner.
Add your answer
Loading...

Leave a comment

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