डाउनलोड पी.डी.एफ. ई-बुक्स
C++ - Check Palindrome Number

विवरण :

कोई विवरण नहीं है |


सोर्स कोड :

#include 
#include 
using namespace std;

int main() {
int num1, num2, remainder, reverse = 0;

cout<<"Enter any number: ";
cin>>num1;

num2 = num1;
while (num1 != 0){
remainder = num1 % 10;
num1 = num1 / 10;
reverse = reverse * 10 + remainder;
}

if (num2 == reverse){
cout<<"Entered Number is palindromic number .";
}
else{
cout<<"Entered Number is Not palindromic number .";
}

return 0;
}

आउटपुट :

Enter any number: 454
Entered Number is palindromic number .