83. WAP to print palindrome number by user defined range
#include<stdio.h>
void
main()
{
int r,i,rev,temp,n1,n2;
printf("WAP to print palindrome
number by user defined range \n");
printf("Enter lower range :
");
scanf("%d",&n1);
printf("Enter upper range :
");
scanf("%d",&n2);
for(i=n1;i<=n2;i++)
{
temp=i;
for(rev=0;temp;temp=temp/10)
{
r=temp%10;
rev=rev*10+r;
}
if(rev==i)
printf("%d ",i);
}
printf("\n");
}
Comments
Post a Comment