#include
#include
void main()
{
char str[10][10],temp[10];
int i,n,j,c;
clrscr();
printf("\nEnter the number of strings to be entered:");
scanf("%d",&n);
printf("Enter the strings:");
for(i=0;i
for(i=0;str[i]!='\0';i++)
for(j=i+1;j
c=strcmp(str[i],str[j]);
if(c>0)
{
strcpy(temp,str[j]);
strcpy(str[j],str[i]);
strcpy(str[i],temp);
}
}
printf("\nThe strings after sorting are:\n");
for(i=0;i
getch();
}
No comments:
Post a Comment