Consider a scenario where you need to execute a block of code for each element in an array. Which control structure is most suitable for this purpose?

  • for loop
  • if statement
  • switch statement
  • while loop
A 'for' loop is the most suitable control structure for iterating through each element in an array. It allows you to specify the start and end conditions and easily iterate through array elements.
Add your answer
Loading...

Leave a comment

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