Hello,
This is what I have so far. It reads in a message than prints the message in reverse. How do I compare the array's in order to find out if the message is a palindrome or not?
If there is a easier way, please show me. Can you do it with out using strings?
#include <stdio.h>
#define N 10
main()
{
int i, a[N];
printf("Enter a message: "
for (i = 0; i < N; i++)
scanf("%c", &a);
printf("In reverse order: "
for (i = N - 1; i >= 0; i--)
printf("%c", a);
printf("\n"
return 0;
}
Thanks,
Doug
This is what I have so far. It reads in a message than prints the message in reverse. How do I compare the array's in order to find out if the message is a palindrome or not?
If there is a easier way, please show me. Can you do it with out using strings?
#include <stdio.h>
#define N 10
main()
{
int i, a[N];
printf("Enter a message: "
for (i = 0; i < N; i++)
scanf("%c", &a);
printf("In reverse order: "
for (i = N - 1; i >= 0; i--)
printf("%c", a);
printf("\n"
return 0;
}
Thanks,
Doug