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();
}

yashan has written 69 articles

4 thoughts on “C program to print palindrome series up to inputted number

    1. Kailey says:

      What about the sequestered carbon in the rigid foam insulation? The way I figure it, polystyrene is 92% Carbon so should be sequestering 92kgC/kg. That makes polystyrene a net carbon sink of 24kgC/kg!Ok, perhaps that's taking things a bit far but if we want to stop pelcrchemioats being burned, why not use them in our walls, floors and roofs? I can't think of a less damaging use for them…

    2. clue report says:

      I was just listening to a radio show and the host asked a question about 1950 US TV programs. One program ran afoul of the censor because it dared to show…a full view of a toilet. After much discussion it was allowed to go on when it only show a toilet cover. It marked the first time on TV when any part of a toilet was shown. This is a long winded way to say censors are the same the world over: humorless men (they are men only) who knows nothing about what they are seeing.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>