breakfor.c (292B)
1 /* Esercizio 4.37 */ 2 3 #include <stdio.h> 4 5 int main() 6 { 7 int x, i; 8 9 for(x = 1; x <= 10; x++) { 10 11 if (x == 5) { 12 i = x; 13 x = 11; 14 } 15 else 16 printf("%d ", x); 17 18 } /* end for (x) */ 19 20 printf("\nBroke out of loop at x == %d\n", i); 21 22 return 0; 23 } /* E0F main */ 24