- Joined
- Jan 25, 2011
- Messages
- 2,384
In my Algebra Class, we are asked to print out all the subsets in a set.
Example Output:
Type the number of elements: 3
Enter Element : 1
Enter Element : 2
Enter Element: 3
Name of the set: A
A = {1,2,3}
The subsets are:
A = { }
A = {1}
A = {1,2}
A = {2,3}
A = {2}
A = {1,3}
A = {3}
A = {1,2,3}
Additional Info: To get the number of subsets in a set, 2 raise to (number of elements)
Advance thanks and I hope someone could help me. BTW please use array.
Example Output:
Type the number of elements: 3
Enter Element : 1
Enter Element : 2
Enter Element: 3
Name of the set: A
A = {1,2,3}
The subsets are:
A = { }
A = {1}
A = {1,2}
A = {2,3}
A = {2}
A = {1,3}
A = {3}
A = {1,2,3}
Additional Info: To get the number of subsets in a set, 2 raise to (number of elements)
Advance thanks and I hope someone could help me. BTW please use array.
Last edited: