This recursive function calls subset function to print the subsets one by one . numBits -- > number of bits needed to represent the number ( simply input value n ) . num -- > Initially equal to 2 ^ n - 1 and decreases by 1 every recursion until 0.
void printSubsets ( int numOfBits , int num ) { if ( num >= 0 ) { cout << " { ▁ " ;