How do I solve this C++ code project?
In the code project of the Functions module/chapter 'Palindrome Numbers' all the test cases are passed except test case 5. I tried several times but It didn't work. Can anyone help? This is the code: #include <iostream> using namespace std; string reverse(string str){ int n = str.length(); for(int i=0; i<=n/2; i++){ swap(str[i], str[n-i-1]); } return str; } bool check_palindrome(string str){ string str_reversed = reverse(str); if(str_reversed==str){ return true; } else{ return false; } } int main() { string n; cin>>n; if(check_palindrome(n)) { cout <<n<<" is a palindrome"; } else { cout << n<<" is NOT a palindrome"; } return 0; }