1#include <stdio.h>
2
3void sorted_string(char s[]){
4 char temp;
5 int i,j,len=strlen(s);
6
7 for(i=0;i<len;i++){
8 for(j=0;j<len;j++){
9 if(s[i] < s[j]){
10 temp=s[i];
11 s[i]=s[j];
12 s[j]=temp;
13 }
14 }
15 }
16
17 //printf("string after sorting %s\n",s);
18}
19
20int main(){
21 char s[1001];
22 scanf(" %[^\n]", s);
23 printf("String before sorting : %s\n",s);
24 sorted_string(s);
25 printf("String after sorting : %s\n",s);
26 return 0;
27}