1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#include <stdio.h> #include <math.h> int main (void) { long max, val = 0; size_t cnt; cnt = 3; for ( max = (long) pow (2., cnt) ; val != max ; ++val ) printf ("%ld ", val); printf ("\n"); return 0; }
1
0 1 2 3 4 5 6 7