// Example of goto statement in C // I've seen a lot of C code over the years, but have never seen a goto implemented, // probably because it is considered to be 'bad practice'. But the C/C++ language // supports the goto statement. In assembly language, all looping is essentially // done with goto statements, so they are not inherently evil, but can create // spaghetti code when misused. That is why they are "considered harmful." // written by Lee Devlin 2011-02-20 #include int main() { int i=0; label: printf("hello world\n"); if(i++ < 10) goto label; printf("Press any key to continue\n"); getch(); }