+ 2

Someone will tell me what's wrong with this code?

#include <iostream> #include <string> #include <algorithm> using namespace std; int main() { string str1,str2; cout<<"Enter the string:-\n"; cin>>str1; reverse(str1, str1.end()); if(str1!=str2) { cout<<"string is not polindrome"<<endl; } else { cout<<"string is polindeome"<<endl; } return 0; }

24th Jun 2022, 7:13 AM
SAMIR KADIVAR
SAMIR KADIVAR - avatar
2 Answers
+ 2
Thanks now it's working
24th Jun 2022, 7:36 AM
SAMIR KADIVAR
SAMIR KADIVAR - avatar