8.41 / 8.42 Write a program to enter names of cities and display all the entered names
alphabetically.
# Include <stdlo.h>
# include <ccoio.h>
void main()
{
char city [5] [20];
int, i#j;
clrscrO;
printf ("Enter Names of Cities.\n\n");
for (i=0,'i<5,'i++)
scanf ("%s"jnty[i]);
printf ("Sorted List ofCities.\n\n");
for(i=65,i'<=122/i‘++>
/
for (j=0,j<5,j++)
{
if (city[j][0]ssi)
printf (u\n%s"jHty[j1);
}
}
OUTPUT:
Enter Names of Cities.
MUMBAI
NANDED
BANGLORE
KANPUR
INDORE
Sorted List of cities.
BA ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.