top of page
Wave
Cactus%20Plant_edited.jpg

PALINDROME NUMBER

#include<stdio.h>
int main()
{
    int n,z,r,s;
    printf("Enter the number: ");
    scanf("%d",&n);
    s=0;
    z=n;
    while(z!=0)    
    {
        r=z%10;
        s=(s*10 )+r;
        z=z/10;
    }
    if(s==n)
        printf("\nThe number is a palindom number.\n");
    else
        printf("\nThe number is not a palindom number.\n");
    return 1;
}

Cactus%20Plant_edited.jpg

PALINDROME NUMBER RANGE

#include<stdio.h>
int main()
{
    int n,z,r,s,a,b;
    printf("Enter the lower limit of the range: ");
    scanf("%d",&a);
    printf("\nEnter the upper limit of the range: ");
    scanf("%d",&b);
    printf("\nPalindom numbers are: \n\n");
    for(n=a;n<=b;n++)
    {
        s=0;
        z=n;
        while(z!=0)    
        {
            r=z%10;
            s=(s*10 )+r;
            z=z/10;    
        }
        if(s==n)
            printf("%d ",s);
    }
    return 1;
}

Subscribe Form

Thanks for submitting!

  • Facebook
  • YouTube
  • Instagram
  • Twitter

©2020 by Abhisek Midya ( A18 )

bottom of page