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