Testing.

Sunday, 22 January 2017

C programming language: C program to print list of palindrome numbers from the given range.


#include<stdio.h>
#include<conio.h>
void main()
{
int rem,revNum=0,num,start,end,temp;
printf("\nEnter Two Numbers : ");
scanf("%d%d",&start,&end);
for(num=start;num<=end;num++)
{
temp=num;
revNum=0;
       while(temp)
       {
         rem=temp%10;
         revNum=revNum*10+rem;
         temp=temp/10;
         if(num==revNum)
 printf("\nPALINDROME NUMBER: %d ",num);
       }
}
getch();
}

No comments:

Post a Comment