#include<stdio.h>//header file
#include<conio.h>//header file
void main() //starting of the main() function
{
int m,flag=0,l,i; //declaration of the variables
char a[10];
clrscr();
printf("program that checks whether a given string is pallendrome or not");
printf("\n\n\n\t\t------------INPUT-------------");
printf("\n\nenter the string to be checked pallendrom or not");
scanf("%s",&a);//taking input from the user
l=strlen(a);
m=l-1;
for(i=0;i<l/2;i++)
{
if(a[i]!=a[m])
{
flag=1;
break;
}
m--;
}
printf("\n\n\n\t\t------------OUTPUT------------");
if(flag==0)
printf("\n\nstring is pallendrome");//printing output
else
printf("\n\nstring is not pallendrome");//printing output
getch();
}