CCCCCCCCCCCCCCCCC

Tuesday, 24 December 2019

C program to check the given number is palindrome or not.

#include<stdio.h>
void main()
{
    int n, temp, sum=0,d;
    printf("\n enter the number:");
    scanf("%d",&n);
    temp=n;
    while (n!=0)
    {
        d=n%10;
        sum = sum*10+d;
        n = n/10;
    }
    if (temp==sum)
        printf("\n the number is Palindrome.");
    else
        printf("\n the number is not Palindrome.");
    getch();
}

No comments:

Post a Comment