#include <stdio.h>
#include <string.h>
#define LENGTH 50
int
main (void)
{
char city1[50], city2[50];
int comp;
printf ("Comparison of two city names\n");
printf ("============================\n\n");
printf ("Enter the name of the first city (<50 letters): ");
fgets (city1, LENGTH, stdin);
city1[strlen(city1)-1] = '\0';
printf ("Enter the name of the second city (<50 letters): ");
fgets (city2, LENGTH, stdin);
city2[strlen(city2)-1] = '\0';
comp = strncmp (city1, city2, LENGTH);
if (comp < 0)
printf ("\n\n%s < %s.\n", city1, city2);
else
if (comp == 0)
printf ("\n%s = %s.", city1, city2);
else
printf ("\n%s > %s.", city1, city2);
return (0);
}