Position of backslash n

why does backslash n come after the endwhile, shouldn’t it be placed inside the nested loop