C program to arrange names in alphabetical order

C program to arrange names in alphabetical order

Output:

How many words to sort ?
6
Enter the strings:
acb
bac
bca
cab
cba
abc
The sorted names are:
abc
acb
bac
bca
cab
cba

Implementation: