Which control structure in Go is used to execute one of many blocks of code based on the value of an expression?

  • for loop
  • goto statement
  • if statement
  • switch statement
The switch statement in Go is used to execute one of many blocks of code based on the value of an expression. It provides a clean and efficient way to handle multiple cases without excessive nesting.
Add your answer
Loading...

Leave a comment

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