TheAlgorithms-C-Plus-Plus/others/palindrome_of_number.cpp
Krishna Vedala fb3a8091f9
fixed lint
2020-05-26 09:26:40 -04:00

21 lines
333 B
C++

#include <algorithm>
#include <iostream>
int main() {
int num;
std::cout << "Enter number = ";
std::cin >> num;
std::string s1 = std::to_string(num);
std::string s2 = s1;
reverse(s1.begin(), s1.end());
if (s1 == s2)
std::cout << "true";
else
std::cout << "false";
return 0;
}