// PALINDROME NUMBER
# include <stdio.h>
int main()
{
int n,REV=0,TEMP;
printf("Enter any integer value : ");
scanf("%d",&n);
TEMP = n;
while(n!=0)
{
REV = REV*10;
REV = REV + n%10;
n=n/10;
}
if(REV==TEMP)
{
printf("Number is Palindorme");
}
else
{
printf("Number is not Palindrome");
}
}
// PALINDROME SERIES
# include <stdio.h>
int main()
{
int n,REV=0,TEMP;
for(n=1;n<=200;n++)
{
TEMP = n;
while(TEMP!=0)
{
REV = REV*10;
REV = REV + TEMP%10;
TEMP=TEMP/10;
}
if(REV==n)
{
printf("%d ",n);
}
REV=0;
}
return 0;
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.