Index
1. First C program 2. Data Types in C 3. Format Specifiers in C 4. Operators in C 5. Operator Precedence, Associativity of Operators 6. Increment and Decrement Operators 7. Bitwise Operators in C 8. Ternary Operators in C 9. Switch Statement 10. Functions in C 11. Call by value and Call by Reference 12. Storage Classes in C 13. Array in C 14. Two Dimensional Arrays 15. Strings in C 16. String Functions in C 17. Structure in C 18. Union in C 19. Dynamic Memory Allocation in C 20. C Programming Tutorial: Understanding Comments and Identifiers with Code ExamplesWhat is palindrome number in C?
In this article, we are going to cover the following points
- What is Palindrome number in C?
- Algorithm of Palindrome number
- Implementation of Palindrome Program
Palindrome numbers are referred to as those numbers which give the same number after reversing that number.
For example: Suppose a given number is 1551, then the palindrome number of the given number will be 1551.
2) Palindrome number of 343 will be 343.
Algorithm for Palindrome number in C
Lets write the basic algorithm to check whether the given number is palindrome or not.
- Get the number as input from the user.
- Hold the given number in a new temporary variable.
- Reverse the given number.
- Compare the temporary number with a reversed number.
- If both the temporary number and reverse numbers are the same, then the given number will be palindrome else number is not a palindrome.
Implementation of Algorithm
Write a program to reverse a number and check whether a given number is palindrome or not.
#include int main() { int i=1551,j; j = i; int n,rem,quo,newnumber=0; for(n=1;n<=4;n++) { rem=i%10; if(n == 4) { newnumber=(newnumber+rem); } else { newnumber=(newnumber+rem)*10; } quo=i/10; i=quo; } printf(" New number = %d",newnumber); printf(" Old number = %d",j); if(j == newnumber) { printf(" Palindrome"); } else { printf(" Not Palindrome"); } }
Output
New number = 1551 Old number = 1551 PalindromePrevious Next

NEWSLETTER
Coding Bytes by Codzify
Welcome to Coding Bytes, your weekly source for the latest coding tutorials and insights in small byte sized content.
Join 798+ Subscribers
Subscribe on LinkedInMonetize your Passion Today!
Join Codzify Affiliate Program, Earn 30% Commission on Course Sales, Get ₹449.7 or $5.41 per course Sale! No Follower Requirement. Monetize Your Passion Today!
Register NOW!Codzify Youtube Channel
Ready to level up your Full Stack App development Skills? Check out Codzify Youtube Channel for interatcive video content.
Subscribe Codzify