what is wrong with my code?
in inputs like "radar" or "tttt" should say its palindrome.
#include <iostream>
using namespace std;
bool testpalindrome(string,int,int);
int main()
{
string wordX;
bool result;
cout<<"Enter string: ";
getline(cin,wordX);
result=testpalindrome(wordX,wordX.length()-1,0);
result==true ? cout<<"\nthe string is palindrome!" : cout<<"\nthe string is NOT palindrome!\n";
}
bool testpalindrome(string word,int last,int start)
{
if (last==0)
{
return true;
}
else
{
if(word[start]!=word[last])
return false;
else
testpalindrome(word,last-1,start+1);
}
}