Find all possible subset of a given set
Code:
If we have set A that is represented as A = {1,2,3,4}. How can we generate the all possible of set B such that B is subset of A and A is not equal to B by writing C or C++ programming.
Ex. If A = {1,2,3,4} then, we will have the all possible of set B under above condition as following:
B1={1}, B2={2}, B3={3}, B4={4},
B5={1,2}, B6={1,3}, B7={1,4},
B8={2,3}, B9={2,4}, B10={3,4},
B11={1,2,3}, B12={1,2,4}, B13={1,3,4}, B14={2,3,4}
Note: we think that two sets that have the same member are the same set althrough they have different sequence. For example set {1,2,3} or {3,1,2} are the same set.