Question: How to Generate Multiple Loop Automatically

Hi all,

I want to design a procedure which can generate multiple loop automatically. While I  assign a value to it, it will create a multiple loop with same number of layers.    

For example,

P(1):

for i from 1 to n do
...
end do:

 

p(2):

for i from 1 to n do

for j from 1 to n do
...

end do: end do:

 

p(3)...

p(4)...

...

 

 

 

I'd appreciate any help on this topic. Thank a lot.

 

Please Wait...