How can I generate all possible binary numbers like below:
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
List<int> GetAllPossibleBinaryNumbers(int length) {
}
In above GetAllPossibleBinaryNumbers
accepts length
as the number of bits, and returns all possible binary values.