From 9e6cd3bb7ceba514ecd510fbf633ee13dcfd3a4b Mon Sep 17 00:00:00 2001 From: Ashwek Swamy <39827514+ashwek@users.noreply.github.com> Date: Sun, 10 Feb 2019 12:10:29 +0530 Subject: [PATCH] Update Palindromeofnumber.cpp --- Palindromeofnumber.cpp | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/Palindromeofnumber.cpp b/Palindromeofnumber.cpp index a960ec854..8bfdfb073 100644 --- a/Palindromeofnumber.cpp +++ b/Palindromeofnumber.cpp @@ -1,20 +1,23 @@ -#include +#include +#include + using namespace std; int main() { -int num; -cin>>num; + int num; + cout << "Enter number = "; + cin >> num; -string s1 = to_string(num); -string s2 = s1; + string s1 = to_string(num); + string s2 = s1; -reverse(s1.begin(),s1.end()); + reverse(s1.begin(),s1.end()); -if(s1==s2) - cout<<"true"; -else - cout<<"false"; + if(s1 == s2) + cout<<"true"; + else + cout<<"false"; -return 0; + return 0; }