Print the two strings, firstString and secondString, in alphabetical order. Assume the strings are lowercase. End with newline. Sample output:
#include <stdio.h>
#include <string.h>
int main()
{
  char firstString[200], secondString[200];
  printf("Input first string:");
  scanf("%s", firstString);
  printf("Input second string:");
  scanf("%s", secondString);
  Â
  if (strcmp(firstString, secondString) < 0)
    printf("%s %s\n", firstString, secondString);
  else
    printf("%s %s\n", secondString, firstString);
  return 0;
}
Comments
Leave a comment