#include <iostream>#include <string>using namespace std;// Recursive function to check if a string is a palindromebool isPalindrome(const string& str, int start, int end) {// Base caseif (start >= end) {return true;}// If characters don't matchif (str[start] != str[end]) {return false;}// Recursive callreturn isPalindrome(str, start + 1, end - 1);}int main() {string input;cout << "Enter a string: ";cin >> input; // reads a single word (no spaces)if (isPalindrome(input, 0, input.length() - 1)) {cout << input << " is a palindrome." << endl;} else {cout << input << " is not a palindrome." << endl;}return 0;}