
280 Programming and Data Structures
I
for (i=l,i<=5-l,i++)
for (j=l,i<=5-ij++)
if(strcmp(name[j-l],name[j])>0)
I
strcpy(temp,name[j-l]);
strcpy(name[j-l],name[j]);
strcpy(name[j],temp);
strcpy(temp,mobilelj-l]);
strcpy(mobile[j-l],mobile[j]);
} strcpy(mobile[j],temp);
printf ("L is t o f Customers in alphabetical Order.");
for (i=0,i<5;i++)
print)f("\n% -20s\t% -10s\n",name[i],m obile[i]);
OUTPUT:
Enter Names and Mobile Numbers.
K S MORE 458454
JMCHATE 658963
M M GORE 660585
L K jA IN 547855
j J JOSHI 354258
List of Customers in alphabetical Order.
CHATEJM 658963
GORE M M 660585
JAIN LK 547855
JOSHI JJ 354258
MOKE KS 458454
Explanation