Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created October 5, 2021 07:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/54625f2ec1bea7bbdd6ebe5f6b37ba0c to your computer and use it in GitHub Desktop.
Save amankharwal/54625f2ec1bea7bbdd6ebe5f6b37ba0c to your computer and use it in GitHub Desktop.
#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