Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int recursion(int num, int rem)
- {
- if(num == 0)
- {
- return rem;
- }
- rem = rem *10 + (num % 10);
- return recursion(num/10,rem);
- }
- int main()
- {
- int n;
- cin>>n;
- //cout<<recursion(n,0)<<endl;
- if(recursion(n,0) == n)
- {
- cout<<"pallindrome number"<<endl;
- }
- else
- {
- cout<<"not a pallindrome number"<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement