Sorting in Alphabetical Order

Sample C Program to sort the given set of words in alphabetical order

  1. #include<stdio.h>
  2. #include<string.h>
  3. #define MAXITEMS 10
  4. #define MAXCHAR 20
  5. "\tSORTING IN ALPHABETICAL ORDER\n""\t******************************\n");
  6. /* Reading the list */"\n Enter Number of names(Max.%d): ",MAXITEMS);
  7. scanf("%d""%s"/* Sorting begins *//* Outer loop begins *//*Inner loop begins*//* Exchange of contents *//* Inner loop ends */
  8. } /* Outer loop ends */
  9. /* Sorting completed */"\n\tAlphabetical list \n\n""%s\n""\t****************************\n");
  10.  
  11. getch ();
  12. }