#include<stdio.h>
main()
{
int sum=0,rem,rev=0,t=0,n;
clrscr();
printf("\nEnter an integer number");
scanf("%d",&n);
t=n;
while(n>0)
{
rem=n%10;
rev=rev*10+rem;
sum=sum+rem;
n=n/10;
}
printf("Sum of digits= %d\n",sum);
printf("\nReverse of the digit is %d",rev);
if(t==rev)
{
printf("\nPalindrome number");
}
else
{
printf("\nNot a Palindrome number\n");
}
getch();
}
Comments
Post a Comment