Question:Write a c program for palindrome within a range. 

Answer 
#include<stdio.h>
int main(){
    int num,r,sum,temp;
    int min,max;

    printf("Enter the minimum range: ");
    scanf("%d",&min);

    printf("Enter the maximum range: ");
    scanf("%d",&max);

    printf("Palindrome numbers in given range are: ");
    for(num=min;num<=max;num++){
         temp=num;
         sum=0;

         while(temp){
             r=temp%10;
             temp=temp/10;
             sum=sum*10+r;
         }
         if(num==sum)
             printf("%d ",num);
    }
    return 0;
}
Sample output: Enter the minimum range: 1 Enter the maximum range: 50 Palindrome numbers in given range are: 1 2 3 4 5 6 7 8 9 11 22 33 44 

+ ExplanationNot Moderated
+ Report
Total Preview: 622
Write a c program for palindrome within a range.
Copyright © 2024. Powered by Intellect Software Ltd