sorted characters in a string in c
#include <stdio.h>
void sorted_string(char s[]){
char temp;
int i,j,len=strlen(s);
for(i=0;i<len;i++){
for(j=0;j<len;j++){
if(s[i] < s[j]){
temp=s[i];
s[i]=s[j];
s[j]=temp;
}
}
}
//printf("string after sorting %s\n",s);
}
int main(){
char s[1001];
scanf(" %[^\n]", s);
printf("String before sorting : %s\n",s);
sorted_string(s);
printf("String after sorting : %s\n",s);
return 0;
}