#include<iostream.h> #include<conio.h> #include<string.h> #include<stdio.h> void main() { clrscr(); int i,len,j=0,flag,k; char str[100],king[100]; cout<<"enter a string"; gets(str); cout<<" the string you have entered is "<<str<<endl; len=strlen(str); for(i=0;i<len;++i)> { if(str[i]!=' ') { king[j]=str[i]; j++; } if(str[i]==' ') { for(int f=0, k=1;king[f]{ if(king[f]==king[j-k]) { flag=1; } else { flag=0; break; } j=0; } } } if(flag==1) cout<<"YOU HAVE ENTERED A STRING PALINDROME which is"<<king; if(flag==0) cout<<"you have not entered any string palindrome "; getch(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)