# Thread: how to list all of 7C4

1. ## how to list all of 7C4

I have 7 elements and I want to list all subsets of size 4

ie: 7C4=35

so i want to explicitly list the 35 elements, does anyone know an method for doing this?

2. I think the following algorithm should work.

Code:
for x1 = 1 to 7
for x2 = x1 + 1 to 7
for x3 = x2 + 1 to 7
for x4 = x3 + 1 to 7
print x1, x2, x3, x4