We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 227dcf0 commit 9e6cd3bCopy full SHA for 9e6cd3b
Palindromeofnumber.cpp
@@ -1,20 +1,23 @@
1
-#include<bits/stdc++.h>
+#include <iostream>
2
+#include <algorithm>
3
+
4
using namespace std;
5
6
int main()
7
{
-int num;
-cin>>num;
8
+ int num;
9
+ cout << "Enter number = ";
10
+ cin >> num;
11
-string s1 = to_string(num);
-string s2 = s1;
12
+ string s1 = to_string(num);
13
+ string s2 = s1;
14
-reverse(s1.begin(),s1.end());
15
+ reverse(s1.begin(),s1.end());
16
-if(s1==s2)
- cout<<"true";
-else
17
- cout<<"false";
+ if(s1 == s2)
18
+ cout<<"true";
19
+ else
20
+ cout<<"false";
21
-return 0;
22
+ return 0;
23
}
0 commit comments