#include<stdio.h>
#include<string.h>
struct student
{
char name[1000];
} s[1000];
int main ()
{
char temp[1000];
int n, i = 1, j = 0;
printf ("enter the no of strings:");
scanf ("%d", &n);
printf ("enter the strings");
for (i = 0; i < n; i++)
{
printf ("\nenter the string:");
scanf ("%s", s[i].name);
}
for (i = 0; i < n; i++)
for (j = 0; j <= n; j++)
{
if (strcmp (s[i].name, s[j].name) < 0)
{
strcpy (temp, s[i].name);
strcpy (s[i].name, s[j].name);
strcpy (s[j].name, temp);
}
}
printf ("Printing the resultant : \n");
for (i = 0; i < n; i++)
printf ("%s\t\n", s[i].name);
return 0;
}