Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Break Statement | Control Structures
Introduction to GoLang

Break StatementBreak Statement

The break keyword can be used to prematurely exit a loop, even if it has not reached its stop condition.

Here's an example of how break can be used inside a loop:

go

index.go

The provided code terminates the loop when i==3 instead of i==5. Any code after the break statement within the loop is automatically ignored since the loop breaks at that specific point.

The break keyword, also referred to as the break statement, can be a valuable tool for controlling the loop's flow. It enables you to impose additional conditions within the loop.

Which lines will be included in the output of the following code?

Виберіть правильну відповідь

Все було зрозуміло?

Секція 3. Розділ 7
course content

Зміст курсу

Introduction to GoLang

Break StatementBreak Statement

The break keyword can be used to prematurely exit a loop, even if it has not reached its stop condition.

Here's an example of how break can be used inside a loop:

go

index.go

The provided code terminates the loop when i==3 instead of i==5. Any code after the break statement within the loop is automatically ignored since the loop breaks at that specific point.

The break keyword, also referred to as the break statement, can be a valuable tool for controlling the loop's flow. It enables you to impose additional conditions within the loop.

Which lines will be included in the output of the following code?

Виберіть правильну відповідь

Все було зрозуміло?

Секція 3. Розділ 7
some-alt