如何实现让某些语句按照一定的条件重复执行呢?

比如:打印从0 – N的值?
例子: goto语句

#include
#include
void MyPrint(int x)
{
    int i = 0;
B:
    printf("%d\n",i);
    i++;