I have a code with n nested loops. Every loop has X iterations.
Is it possible to make this code into some structure that would do the same job for any particular integers n, x?
I think, this could be done somehow with recursion. If yes, is it possible to make it without recursion as well? Could you please, post that code or post some link(s)?
for (int i_1=0; i_1<X; i_1++){ //first loop
for (int i_2=0; i_2<X; i_2++){ //second loop
...
for (int i_n=0; i_n<X; i_n++){ //n-th loop
print(i+ " " + i_2 +" "..." "+i_n);
}
...
}
}
Thank you.


Sign In
Create Account


Back to top









