84. Program to print [x] palindrome numbers starting from [y]
#include<stdio.h>
void
main()
{
int r,i,rev,temp,p,n1,n2;
printf("Program to print [x]
palindrome numbers starting from [y] \n");
printf("Enter starting range :
");
scanf("%d",&n1);
printf("Enter how many numbers you
want : ");
scanf("%d",&n2);
for(i=n1,p=0;p<n2;i++)
{
temp=i;
for(rev=0;temp;temp=temp/10)
{
r=temp%10;
rev=rev*10+r;
}
if(rev==i)
{
printf("%d ",i);
p++;
}
}
printf("\n");
}
Comments
Post a Comment