[C]goto statement, rarely been used. Deprecated???

#include <stdio.h>
int main()
{
    int a = 0;
    while (a < 10){
        printf("a is %d
", a);
        if ( a == 5)
            goto OUT;
        a++;
    }
    OUT:
        printf("We're out of the loop.
");
    return 0;
}

运行结果为:

a is 0
a is 1
a is 2
a is 3
a is 4
a is 5
We're out of the loop.
原文地址:https://www.cnblogs.com/profesor/p/13053344.html