diff --git a/CPP/To_count_palindrome_string.cpp b/CPP/To_count_palindrome_string.cpp new file mode 100644 index 0000000..54571f7 --- /dev/null +++ b/CPP/To_count_palindrome_string.cpp @@ -0,0 +1,36 @@ +#include +#include +using namespace std; +int main(){ + char s1[100][100],s[100]; + int k=0,j=0,c=0,count=0; + cout<<"Enter a string: "; + cin.getline(s,100); + for(int i=0;s[i]!='\0';i++){ + if(s[i]==' '){ + s1[k][j]='\0'; + k++; + j=0; + } + else{ + s1[k][j]=s[i]; + j++; + } + } + s1[k][j]='\0'; + for(int i=0;i<=k;i++){ + c=0; + int n=strlen(s1[i]); + for(j=0;j