-
-
Save amankharwal/54625f2ec1bea7bbdd6ebe5f6b37ba0c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main(){ | |
int n; | |
int count; | |
int reverse; | |
cout<<"Enter a Number to Check If It is Palindrome or not: "; | |
cin>>n; | |
reverse = 0; | |
int i = n; | |
do{ | |
count = n % 10; | |
reverse = (reverse * 10) + count; | |
n = n / 10; | |
}while (n != 0); | |
if (i == reverse){ | |
cout<<"Yes, it is a Palindrome Number!"; | |
} | |
else{ | |
cout<<"No, it is not a palindrome number!"; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment