Not that you should use a "goto" in your program your first problem is that "top:" needs to be inside the opening brace of main.
is there any function that allows writing to specific line? not really sure what you mean by "writing to specific line".
The corrected code will be an endless loop printing one "word1" after another with no way to stop. A slightly better solution would be:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#include <iostream>
#include <cstdlib>
int main()
{
int i{ 0 };
do
{
std::cout << "word1 "; //change this word to something else
i++;
} while (i < 5);
system("pause"); // not the best choice, but will do for now
return 0;
}