I'm trying to find all possible sub-sequence of a string. For example "abc" in this string we will find total 8 string 2^3=8 combinations. like a, b, c, ab, ac, bc, abc '\0'. But my code is only printing all character of the string. How can I do that?
#include <stdio.h>
#include <stdlib.h>
int main()
{
char string[1000];
int count, i;
gets(string);
int len = strlen(string);
for(i=0; i<len; i++) {
printf("%c ", string[i]);
}
return 0;
}