Hi, I was trying to write a C program that lists all of the subsets of the set {1,2,...,n}. The program should be ask number of elements in the set from the keyboard, and the order must be shown in the example.
For example;
Enter the number of elements: 3
The subsets of {1,2,3} are :
1.<Empty set>
2. {1}
3. {2}
4. {3}
5. {1,2}
6. {1,3}
7. {2,3}
8. {1,2,3}
Here is my codes, I have trouble, when I entered 5,4, or 3. (Basiccally entered>=3) It doesnt show all subsets, I spend too much time for this code and I dont wanna get bad grade. Can anybody help me to fix this code, Where şs the problem, and how to fix it?