Answer:
#include <iostream>
#include <array>
using namespace std;
bool isPalindrome(string str) Â
{ Â
int length = str.length(); Â
for (int i = 0; i < length / 2; i++) Â
 if (toupper(str[i]) != toupper(str[length - 1 - i]))
 return false; Â
return true; Â
}
int main()
{
array<string, 6> tests = { "madam", "abba", "22", "67876", "444244", "trymEuemYRT" };
for (auto test : tests) {
 cout << test << " is " << (isPalindrome(test) ? "" : "NOT ") << "a palindrome.\n";
}
}
Explanation:
The toupper() addition forces characters to uppercase, thereby making the comparison case insensitive.