New paste Repaste Download
int foo = 16;
int bar = 0;
printf("bar: ");
for (size_t i = 0; i < (size_t)(foo * 2); i++) {
printf("%d ", bar);
bar = (bar + 1) & (foo - 1);
}
puts("");
// output foo = 16: bar: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// output foo = 54: bar: 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Filename: foo.c. Size: 512b. View raw, , hex, or download this file.

This paste expires on 2026-05-13 18:59:38.496572+00:00. Pasted through web.