fork download
  1. #include <stdio.h>
  2.  
  3. #define FOR(init, condition, increment, body) \
  4. { \
  5.   init; \
  6.   while (condition) { \
  7.   int entered = 0; \
  8.   int finished = 0; \
  9.   do { \
  10.   if (finished) { \
  11.   goto more; \
  12.   } \
  13.   if (entered) { \
  14.   goto more; \
  15.   } \
  16.   entered = 1; \
  17.   body \
  18.   finished = 1; \
  19.   } while (1); \
  20.   if (!finished) { \
  21.   goto out; \
  22.   } \
  23.   more: \
  24.   increment; \
  25.   } \
  26. out:; \
  27. }
  28.  
  29. int main ()
  30. {
  31. FOR(int i = 0, i < 10, i++, {
  32. if (i == 4) continue;
  33. if (i == 6) break;
  34. printf("%d\n", i);
  35. })
  36.  
  37. return 0;
  38. }
  39.  
Success #stdin #stdout 0.01s 1720KB
stdin
Standard input is empty
stdout
0
1
2
3
5