#include <stdio.h>

int main(){
    char a[10] = "adarsh";

    for(int i=0;a[i]!='\0';i++){
        for(int j=i;a[j]!='\0';j++){
            if(a[j]>a[j+1] && a[j+1]!='\0'){
                char tmp = a[j];
                a[j] = a[j+1];
                a[j+1] = tmp;
            }
        }
    }

    printf("%s",a);
}

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: