Which control structure is best suited for executing a block of code multiple times based on a condition?

  • if statement
  • for loop
  • switch statement
  • while loop
A 'for' loop is ideal for executing code repeatedly based on a condition, typically with an initialization, condition, and increment expression.
Add your answer
Loading...

Leave a comment

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