TheAlgorithms-C-Plus-Plus/others/palindrome_of_number.cpp
Krishna Vedala 5f8b270992
file rename
(cherry picked from commit d6d328c8c9)
2020-05-26 10:16:56 -04:00

24 lines
281 B
C++

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