Which control structure in Go is used to execute a block of code repeatedly as long as a condition is true?

  • for
  • if
  • switch
  • while
The 'for' loop in Go is used to execute a block of code repeatedly as long as a specified condition evaluates to true. It is commonly used for iteration over arrays, slices, maps, or to create infinite loops.
Add your answer
Loading...

Leave a comment

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