C program to check for a Palindrome number

The below program checks for a Palindrome number using a loop. The C printf statement is used to output the result on the screen. A number is called as a Palindrome number if the number remains same even when its digits are reversed.

Palindrome Number:
abcde = edcba

Example: 24142, 1234321, etc.

C program to check prime number

#include <stdio.h>
void main()
int num, x = 0;
int sum = 0;
int mod;
printf("Enter a number:");    
int n = num;
mod = num%10;
x = x * 10 + mod;  
num = num/10;
printf ("%d is a Palindrome number.", n);  
printf ("%d is not a Palindrome number.", n);  


Enter a number:456787654
456787654 is a Palindrome number.
Content Protection by DMCA.com
Please Share