palindrome in c using function
#include <stdio.h>
#include <conio.h>
int palindrome (int num);
void main()
{
int n, ret;
printf("Enter the number: ");
scanf("%d",&n);
ret = palindrome(n);
if (ret == n)
printf("\nPalindrome\n");
else
printf("\nNot Palindrome\n");
}
int palindrome(int num)
{
int rem, rev=0;
while (num!=0)
{
rem = num % 10;
rev = rev * 10 + rem;
num /= 10;
}
return rev;
}