#include <stdio.h>
5
6 #define MAX 100
7
8 int main(void)
9 {
10 char msg1[MAX], *p, *q, msg2[MAX];
11
12 printf("Enter a message: ");
13 for (p=msg1; p<msg1+MAX; p++)
14 {
15 *p=getchar();
16 if (*p=='\n')
17 break;
18 }
19
20 for (p--; p>=msg1; p--)
21 {
22 for (q=msg2; q<msg2+MAX; q++)
23 {
24 *q=*p;
25 }
26 }
27
28 if (strcmp(p,q)==0) {
29 printf("Palindrome\n");
30 }
31 else
32 printf("Not a palindrome\n");
33
34 return 0;
35 }
I am trying to see if the inputted message is a palindrome. I put in a palindrome and it sayed it wasn't a palindrome. Any help would be great.