I need an algorithm which generates all possible combination of a set number and output all of them onto Excel spreadsheet.
For example, with n = 5(1,2,3,4,5) and r = 2(created a small gui for this), it will generate all possible combinations and output them into excel spreadsheet like this…
1,2
1,3
1,4
...
The order in which it prints doesn’t matter. It can first print (5,1), then (1,2).
Can anyone show me how to do this?
Thank you very much.
How about this code…