Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created Oct 5, 2021
Embed
What would you like to do?
#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