ok this is the code... and the last part to add the two arrays doesnt work proberly....
Code:
int main(){
char first[80];
char second[80];
char third[160];
printf("Enter a city name:");
fflush( stdout );
if ( fgets(first, 80, stdin ) != NULL )
printf("Enter another city name:");
fflush( stdout );
if ( fgets(second, 80, stdin ) != NULL )
{
if(strcmp(first,second)>0){
printf("Last alphabetically: %s",first);
}
else{
printf("Last alphabetically: %s",second);}
}
{
if(strlen(first,second)>0){
printf("Longest string: %s",first);
}
else{
printf("Longest string: %s",second);}
}
{
strcpy( third, first );
strcat( third, second );
printf( "Joined together: %s\n", third );
}
system("pause");
return 0;
}
i need the first and second to add on one line, without a space