How do I write a program to print proper subset of given
string . Eg :input: abc
output:{},{a},{b},{c},{a,b},{a,c},{b,c},
{a,b,c}.I desperately need this program please mail me to
saravana6m@gmail.com

Answers were Sorted based on User's Feedback



How do I write a program to print proper subset of given string . Eg :input: abc out..

Answer / pankaj

i have written the program to find all the proper subsets,but it doesnt print them in order
ex:
{a,b,c}
it will print:
{}
{a}
{a,b}
{b}
{a,c}
so on
(not in order}
if u want it mail me(goodluck87@gmail.com)

Is This Answer Correct ?    0 Yes 6 No

Post New Answer

More C Code Interview Questions

main() { float i=1.5; switch(i) { case 1: printf("1"); case 2: printf("2"); default : printf("0"); } }

2 Answers  


Write a c program to search an element in an array using recursion

1 Answers   Wipro,


How to reverse a String without using C functions ?

33 Answers   Matrix, TCS, Wipro,


main() { int i; float *pf; pf = (float *)&i; *pf = 100.00; printf("\n %d", i); } a. Runtime error. b. 100 c. Some Integer not 100 d. None of the above

2 Answers   HCL, LG,


main() { int i=400,j=300; printf("%d..%d"); }

3 Answers  






typedef struct error{int warning, error, exception;}error; main() { error g1; g1.error =1; printf("%d",g1.error); }

1 Answers  


What is the match merge ? compare data step match merge with proc sql merge - how many types are there ? data step vs proc sql

0 Answers  


main() { int k=1; printf("%d==1 is ""%s",k,k==1?"TRUE":"FALSE"); }

1 Answers  


Which one is taking more time and why ? :/home/amaresh/Testing# cat time.c //#include <stdio.h> #define EOF -1 int main() { register int c; while ((c = getchar()) != EOF) { putchar(c); } return 0; } ------------------- WIth stdio.h:- :/home/amaresh/Testing# time ./time_header hi hi hru? hru? real 0 m4.202s user 0 m0.000s sys 0 m0.004s ------------------ Witout stdio.h and with #define EOF -1 =================== /home/amaresh/Testing# time ./time_EOF hi hi hru? hru? real 0 m4.805s user 0 m0.004s sys 0 m0.004s -- From above two case , why 2nd case is taking more time ?

0 Answers  


How we print the table of 3 using for loop in c programing?

7 Answers  


What is the main difference between STRUCTURE and UNION?

13 Answers   HCL,


What is "far" and "near" pointers in "c"...?

3 Answers  


Categories