1
0

compback.c 628 B

1234567891011121314151617181920212223242526
  1. /* compback.c -- strcmp returns */
  2. #include <stdio.h>
  3. #include <string.h>
  4. int main(void)
  5. {
  6. printf("strcmp(\"A\", \"A\") is ");
  7. printf("%d\n", strcmp("A", "A"));
  8. printf("strcmp(\"A\", \"B\") is ");
  9. printf("%d\n", strcmp("A", "B"));
  10. printf("strcmp(\"B\", \"A\") is ");
  11. printf("%d\n", strcmp("B", "A"));
  12. printf("strcmp(\"C\", \"A\") is ");
  13. printf("%d\n", strcmp("C", "A"));
  14. printf("strcmp(\"Z\", \"a\") is ");
  15. printf("%d\n", strcmp("Z", "a"));
  16. printf("strcmp(\"apples\", \"apple\") is ");
  17. printf("%d\n", strcmp("apples", "apple"));
  18. return 0;
  19. }