Please help me to print all permutations of a string in C?
How to create a c program to print a alphabet in the form of stars for ex. A should be printed something like
* * * ***** * *
Do we have any standard algo???
#include<stdio.h> #include<string.h> main() { char p[100]; int i,len; printf("Enter a string\n"); scanf("%[^\n]",p); len=strlen(p); for(i=0;i<len-1;i++) { if(a[i]==a[i+1]) p[i]=p[i+1]; } printf("String : %s\n",p); }
* * * * * * * * * * * * * * * * * * *
I above Ouput I Missed two stars.My question is how to find out the remaining stars.Please tel me in the C programming way.