C++ program : How to check waether the Number is Palindrome or Not






C++ program : How to check waether the Number is Palindrome or Not :


#include <iostream>

using namespace std;




int main()
{
int n,temp,rev = 0;
cout << "Enter the Number to check it is Palindrome or Not : " << endl;
cin >> n;
temp = n;
while (temp !=0)
{
rev = rev * 10;
rev = rev + temp % 10;
temp = temp / 10;
}
if (n == rev)
cout << n << " is Palindrome" << endl;
else
cout << n << " is not a Palindrome" << endl;
return 0;
}


Output : 

C++ program : How to check waether the Number is Palindrome or Not
C++ program : How to check waether the Number is Palindrome or Not
C++ program : How to check waether the Number is Palindrome or Not C++ program : How to check waether the Number is Palindrome or Not Reviewed by Awais Shah on 19:53:00 Rating: 5

4 comments:

  1. Very Nice and Informative Code. Thanks
    Regards Pinoy Tv Shows http://www.pinoytvshows.me

    ReplyDelete
  2. Pretty! This has been an incredibly wonderful post. Thank you for providing these details.
    Pinoy Tambayan OFW

    ReplyDelete
  3. Very nice Article good information Great post.Do you want to ask any queries related to your Yahoo from our experts will answer you in no time 2018,Zee TV If you really facing an issues in AOL emails service, for more information visit AOL.

    ReplyDelete

Powered by Blogger.