Check the Number is Palindrome or not
Check the Number is Palindrome or not
#include <iostream>
using namespace std;
int main()
{
int n, num, digit, rev = 0;
cout << "Enter a positive number: ";
cin >> num;
n = num;
do
{
digit = num % 10;
rev = (rev * 10) + digit;
num = num / 10;
} while (num != 0);
cout << " The reverse of the number is: " << rev << endl;
if (n == rev)
cout << " The number is a palindrome.";
else
cout << " The number is not a palindrome.";
return 0;
}
OUTPUT : Enter a positive number: 12321 The reverse of the number is: 12321 The number is a palindrome.
Topics Covered
- palindrome program in c++
- palindrome number in c++
- c++ plaindrome program
- c++ program to checkย palindrome
- palindrome in c++ using for loop
- c++ tutorial
Thanks for reading this blog. Hope you get satisfied with the blog and definitely this blog must have valued your time and effort of reading.
Take a time to connect our other digital creations such as Instagram , Facebook and Youtube.
ย Social Mediaย Linksย ofย Tech DCodeย :
ย YouTube :ย https://www.youtube.com/channel/UCjJnEdeugftBwQ3yMuD4B_A
ย Instagram :ย https://www.instagram.com/thetechdcode/
ย Facebook Page :ย https://www.facebook.com/thetechdcode
ย Twitter :ย https://twitter.com/thetechdcode
ย Telegram Channel :ย https://t.me/thetechdcode
ย Tech DCode Linktree :ย https://linktr.ee/thetechdcode
ย My Personal Handles :ย https://linktr.ee/virtualshivamin
ย Social Media Linksย ofย SHIVAM SINGHย (OWNER) :
ย Instagram :ย https://www.instagram.com/virtualshivamin/
ย Facebook Page :ย https://www.facebook.com/virtualshivamin/
ย Twitter :ย https://twitter.com/virtualshivamin/
ย Personal Linktree :ย https://linktr.ee/virtualshivaminย
ย