#define false 0
#define true 1
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "palindrome.h"
char str[20];
void main()
{
int i,l;
STACK s;
char str[20], ch;
initstack();
printf("Enter a string:");
scanf("%s",str);
l = strlen(str);
printf("Length of string:%d",l);
for(i=0; i<l; i++)
{
printf("\n push str=%c",str[i]);
push(str[i]);
}
for(i=0; i<l; i++)
{
ch=pop();
printf("\n pop ch=%c",ch);
printf("\n str[%d]=%c",i,str[i]);
if(ch!=str[i])
{
printf("\n>> '%s' IS NOT PALINDROME<<\n",str);
exit(0);
}
}
printf("\n>> '%s' IS PALINDROME<<\n",str);
}