fork download
  1. #include <stdio.h>
  2.  
  3. int main(void){
  4. int i, limit = 100, k = 0, divisor = 4;
  5.  
  6. printf("x = ");
  7. for (i = 0; i <= limit; i++) {
  8. if(i % divisor == 0)
  9. ++k;
  10. if(k % 2)
  11. printf ("%d ", i);
  12. }
  13. printf("\ny = ");
  14. for (i = 0, k = 1; i <= limit; i++) {
  15. if(i % divisor == 0)
  16. ++k;
  17. if(k % 2)
  18. printf ("%d ", i);
  19. }
  20. puts("");
  21. }
Success #stdin #stdout 0s 9432KB
stdin
Standard input is empty
stdout
x = 0 1 2 3 8 9 10 11 16 17 18 19 24 25 26 27 32 33 34 35 40 41 42 43 48 49 50 51 56 57 58 59 64 65 66 67 72 73 74 75 80 81 82 83 88 89 90 91 96 97 98 99 
y = 4 5 6 7 12 13 14 15 20 21 22 23 28 29 30 31 36 37 38 39 44 45 46 47 52 53 54 55 60 61 62 63 68 69 70 71 76 77 78 79 84 85 86 87 92 93 94 95 100