Skip to content

Commit

Permalink
Update Palindromeofnumber.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
ashwek authored Feb 10, 2019
1 parent 227dcf0 commit 9e6cd3b
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions Palindromeofnumber.cpp
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
#include<bits/stdc++.h>
#include <iostream>
#include <algorithm>

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;
}

0 comments on commit 9e6cd3b

Please sign in to comment.