listing17-3.c 182 B

123456789
  1. #include <string.h>
  2. int is_palindrome(char *text) {
  3. int i, n = strlen(text);
  4. for (i = 0; i <= n/2; ++i) {
  5. if (text[i] != text[n-i-1]) return 0;
  6. }
  7. return 1;
  8. }