C Program To Check Palindrome Number
Here’s a C Program To Check Palindrome Number using For Loop, While Loop and User – Defined Functions. It is important that we should know How A For Loop Works before getting further with the C Program Code.
What is a Palindrome Number?
A Palindromic Number or Numeral Palindrome is a number that remains Identical or exactly the same when its digits are Reversed. The number is Symmetrical or in other words, it is same even if it is reversed.
Example
12321
This Number is Identical when its Digits are Reversed and hence it is a Palindrome – Number.
Must Read: C Program To Check if String is Palindrome or Not
Method 1: Code To Check Palindrome Integers in C Programming with While Loop
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | #include<stdio.h> int main() { int num1, temp, rem, sum = 0; printf("\nEnter a Number:\t"); scanf("%d", &num1); temp = num1; while(num1 != 0) { rem = num1%10; sum = (sum*10) + rem; num1 = num1/10; } if(sum == temp) { printf("\n%d is a Palindrome Number\n", temp); } else { printf("\n%d is not a Palindromic Number\n", temp); } return 0; } |
Method 2: C Program To Find Palindrome Numbers using For Loop
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | #include<stdio.h> int main() { int num1, temp, rem, sum = 0; printf("\nEnter a Number:\t"); scanf("%d", &num1); for(temp = num1; num1 != 0;) { rem = num1%10; sum = (sum*10) + rem; num1 = num1/10; } if(sum == temp) { printf("\n%d is a Palindrome Number\n", temp); } else { printf("\n%d is not a Palindromic Integer\n", temp); } return 0; } |
Method 3: C Program For Palindrome Number using Functions
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | #include<stdio.h> int palindrome(int x); int main() { int num1, res; printf("\nEnter a Number:\t"); scanf("%d", &num1); res = palindrome(num1); if(res == num1) { printf("\n%d is a Palindrome Number\n", res); } else { printf("\n%d is not a Palindromic Integer\n", res); } return 0; } int palindrome(int x) { int rem, sum = 0; while(x != 0) { rem = x%10; sum = (sum*10) + rem; x = x/10; } return sum; } |
Must Read: C Program To Check if a Number is Special Number or Not
Output

In case you get any Compilation Errors or you have any doubts about this Code To Check Palindrome Number in C Programming, let us know about it in the Comment Section below.
Thanks for so many methods . I want to kmow if we can find Palindrome Numbers using Recursion in C Programming language.
Can you explain the difference between Modulus % operator and Division / Operator?