#include<stdio.h>
#include<conio.h>
void main()
{
int rem,temp,i,n,m,rev=0,count=0;
clrscr();
printf("\nEnter the startig number :- ");
scanf("%d",&n);
printf("\nEnter the ending number :- ");
scanf("%d",&m);
printf("\nPallindrome numbers between a given range are :- \n");
for(i=n;i<m;i++)
{
temp=i;
while(temp!=0)
{
rem=temp%10;
rev=rev*10+rem;
temp=temp/10;
}
if(i==rev)
{
printf(" %d",i);
count++;
}
rev=0;
}
printf("\n\nTotal number of pallindrome between a given range is :- %d",count);
getch();
}
Output:-
Back to 'C Language Programs'
No comments:
Post a Comment