#include #include void printVALUES(int n, int values[]) { for(int i=0 ; i= 0) { if(values[n] <= upper_bounds[n]) { if(n == nloops-1) { printVALUES(nloops, values); values[n]++; } else { n++; values[n] = lower_bounds[n]; } } else { --n; values[n]++; } } } int main(void) { #define NLOOPS 4 int lower_bounds[NLOOPS] = { 1, 1, 1, 1 }; int upper_bounds[NLOOPS] = { 10, 10, 10, 10 }; superloop(NLOOPS, lower_bounds, upper_bounds); return 0; }