30. WRITE A C PROGRAM FIND PALINDROME NUMBERS BELOW RANGE ‘N’ AND PRINT THEM

/*program to print palindrome numbers below range ‘n’*/

#include<stdio.h>
#include<conio.h>
int main()
{
int n1,r,sum=0,n=1,range;
clrscr();
printf(“enter the range\n”);
scanf(“%d”,&range);
do
{
sum=0;
n=n1;
do
{
r=n%10;
sum=(sum*10)+r;
n=n/10;
}
while(n>0)
if(sum==n1)
printf(“%d\n”,n1);
n1++;
}
while(n1<=range);
getch();
return 0;
}

output

enter range
100
1
2
3
4
5
6
7
8
9
11
22
33
44
55
66
77
88
99

Comments