#include <stdio.h>
int main(void)
{
int i,mod,total,temp;
printf("\nEnter a +ve 5 digit number : ");
scanf("%d",&i);
temp = i;
if ( i > 9999 && i <= 99999 )
{
while ( i != 0)
{
mod = i % 10;
total = total * 10 + mod ;
i = i / 10;
}
if (total == temp)
printf("%i is Palindrome ",temp);
else
printf("%i is not Palindrome",temp);
}
else
printf("Pl. Enter a +ve 5 digit number :");
return 0;
}
int main(void)
{
int i,mod,total,temp;
printf("\nEnter a +ve 5 digit number : ");
scanf("%d",&i);
temp = i;
if ( i > 9999 && i <= 99999 )
{
while ( i != 0)
{
mod = i % 10;
total = total * 10 + mod ;
i = i / 10;
}
if (total == temp)
printf("%i is Palindrome ",temp);
else
printf("%i is not Palindrome",temp);
}
else
printf("Pl. Enter a +ve 5 digit number :");
return 0;
}
No comments:
Post a Comment