C program to print palindrome series up to inputted number
Below is the C program in the C programming language to print the palindrome series up the inputted number -
/* C program to print the palindrome series upto the inputted limit */
#include<stdio.h>
void main()
{
int limit,i2,n2,n3=0,i;
printf("Enter limit to print all palindrome no. upto that limit \n");
scanf("%d",&limit);
for(i=1;i<=limit;i++)
{
i2=i;
do
{
n2=i2%10;
i2=i2/10;
n3=n3*10+n2;
}
while(i2>0);
if(n3==i)
{
printf("%d \t",n3);
}
n3=0;
}
getch();
}
No comments yet