Go Continue Statement

The continue is used to skip the remaining part of the loop, and then continues with the next iteration of the loop after checking the condition.

Syntax:-

Or we can do like

Go Continue Statement Example:

Output:

value of a: 1
value of a: 2
value of a: 3
value of a: 4
value of a: 6
value of a: 7
value of a: 8
value of a: 9

Continue can be also be applied in the inner loop

Go Continue Statement with Inner Loop example:

Output:

value of a and b is 1 1
value of a and b is 1 2
value of a and b is 1 3
value of a and b is 2 1
value of a and b is 2 3

Next TopicGo Comments




Hot Tutorials

Contact US

Email:jjw.quan@gmail.com

Go Continue
10/30