#include <iostream>
#include <cstring>
using namespace std;
bool isPalindrome(const char *);
int main() {
char i='a',j='A';
cout<<(int)i<<(int)j;
cout << "Enter a string:";
char s[80];
cin.getline(s, 80);
if(isPalindrome(s))
cout << s << " is a palindrome" << endl;
else
cout << s << " is not a palindrome" << endl;
return 0;
}
bool isPalindrome(const char * const s)
{
int low = 0;
int high = strlen(s) - 1;
while (low < high)
{
if (s[low] != s[high]&&(s[low]+32!=s[high])&&(s[low]-32!=s[high]))
return false;
low++;
high--;
}
return true;
}
#include <cstring>
using namespace std;
bool isPalindrome(const char *);
int main() {
char i='a',j='A';
cout<<(int)i<<(int)j;
cout << "Enter a string:";
char s[80];
cin.getline(s, 80);
if(isPalindrome(s))
cout << s << " is a palindrome" << endl;
else
cout << s << " is not a palindrome" << endl;
return 0;
}
bool isPalindrome(const char * const s)
{
int low = 0;
int high = strlen(s) - 1;
while (low < high)
{
if (s[low] != s[high]&&(s[low]+32!=s[high])&&(s[low]-32!=s[high]))
return false;
low++;
high--;
}
return true;
}