Powered By Blogger

Feb 11, 2025

14. Palindrome Number Check

 #include <stdio.h>

int main() {

    int num, rev = 0, temp, rem;

    printf("Enter a number: ");

    scanf("%d", &num);

    temp = num;

    while (temp != 0) {

        rem = temp % 10;

        rev = rev * 10 + rem;

        temp /= 10;

    }

    if (rev == num)

        printf("Palindrome\n");

    else

        printf("Not a Palindrome\n");

    return 0;

}


No comments:

Post a Comment

Featured Post

Data Analysis

    What is data analysis and its significance?   Data analysis is the process of collecting, transforming, and organizing data to dr...

Popular Posts