#include #include int main() { char str[30]; char *a,*b; printf("Enter any string : "); gets(str); for(a=str ; *a!=NULL ;a++); //here a stores address for 'str' // for(b=str, a-- ; a>=b; ) // b stores address for str// { if(*a==*b) //if we put * sign over a and b then it means the value of str string variable// { a--; b++; } else break; } if(b>a) printf("\nString is palindrome"); else printf("\nString is Not palindrome"); printf("\n\nProgramming at C#ODE STUDIO"); getch(); return 0; }
OUTPUT-
it is showing syntax error in the line
for(b=str,a-;a>=b;)
SORRY!!
IT’S BY MISTAKE, JUST PUT “a- -” WHEREVER I HV WRITTEN “a-” IN THE WHOLE PROGRAM.
program contains errors
Hello Muthu!
The program is working just fine. It also has attached output screen capture. Please make sure that you don’t copy and paste it as it contains ASCII characters. It won’t help you. Thank you for visiting CODE Studio.