#include<stdio.h>

void main(void)

{

 char name[11],temp;

 int i,j;

 

 printf("Enter name (lowercase and within 10 characters): ");

 scanf("%s",name); /* or scanf("%s",&name) */

 

 for(i=0;i<10;++i)

    {

     if(name[i]=='\0')

        break;

     for(j=i+1;j<11;++j)

        {

         if(name[j]=='\0')

            break;

         if(name[i]>name[j])

            {

             temp=name[i];

             name[i]=name[j];

             name[j]=temp;

            }

        }

     }

 

 printf("Re-name: %s\n",name);

}