31 Aug '16 00:561 edit

Does anyone know a general code that can be used to print combinations using basic programming loops? I'm completely stuck on this.

Given user parameters of n and r, I would like a

Example: Given the user parameters

n=4

r = 3

C(4,3) = 1110;1101;1011;0111

So... is there a program structure that will work for C(n,r) in general?

Thanks in advance for any direction on this.

Given user parameters of n and r, I would like a

*simple*code to explicitly print out C(n,r) in 1's and 0's perhaps using For, Do, While Loops ( or other rudimentery language structures) etc...Example: Given the user parameters

n=4

r = 3

C(4,3) = 1110;1101;1011;0111

So... is there a program structure that will work for C(n,r) in general?

Thanks in advance for any direction on this.