Sunday, 9 November 2014

Write c / c++ program that input number from user and tells its palindrome or not.

Leave a Comment
Code:

#include<stdio.h>
int main()
{
    int number,result=0,temp=0;

    scanf("%d",&number);
    temp=number;
    while(number!=0)
    {
        result=result*10;
        result=result+number%10;
        number=number/10;
    }
    printf("%d",result);
    if(result==temp)
    {
        printf("its palindrome number ");
    }
    else
    {
        printf("its not palindrome number");
    }

    return 0;
}


Output


If You Enjoyed This, Take 5 Seconds To Share It

0 Questions: