C program : How to check given number is palindrome number or not 




#include<stdio.h>
int main(){
    int num,r,sum=0,temp;
 
    printf("Enter a number: ");
    scanf("%d",&num);
 
    temp=num;
    while(num){
         r=num%10;
         num=num/10;
         sum=sum*10+r;
    }
    if(temp==sum)
         printf("%d is a palindrome",temp);
    else
         printf("%d is not a palindrome",temp);
 
    return 0;
}

Output:


c programs, c programming, c examples, palindrome number in c


07 Aug 2015

Post a Comment

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.

 
Top