C palindrome program, c program for palindrome


SUBMITTED BY: Guest

DATE: Jan. 21, 2014, 11:22 p.m.

FORMAT: Text only

SIZE: 412 Bytes

HITS: 1133

  1. #include <stdio.h>
  2. #include <string.h>
  3. int main()
  4. {
  5. char a[100], b[100];
  6. printf("Enter the string to check if it is a palindrome\n");
  7. gets(a);
  8. strcpy(b,a);
  9. strrev(b);
  10. if( strcmp(a,b) == 0 )
  11. printf("Entered string is a palindrome.\n");
  12. else
  13. printf("Entered string is not a palindrome.\n");
  14. return 0;
  15. }

comments powered by Disqus