# Problem with Label in a Do loop, “nolabel” [closed]

Can someone tell me why this code doesn't work and how to fix it ? Thanks.

k = 0;
Do[{
Label[top],
k = k + 1,
Print["k = ", k],
If[k < 4, Goto[top]]},
{10}]

k = 1

Hold[Goto[top]]

-

## closed as off-topic by m_goldberg, bobthechemist, Silvia, rasher, Michael E2Apr 2 at 0:32

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – m_goldberg, bobthechemist, Silvia, rasher, Michael E2
If this question can be reworded to fit the rules in the help center, please edit the question.

related –  Kuba Apr 1 at 12:07

Goto first scans any compound expression in which it appears directly, then scans compound expressions that enclose this one.
Your Goto - Label construction is part of the List so Mathematica fails to find the label. Taking this under consideration, the following will work:
k = 0;