Advertisement
sellmmaahh

OR-2007-JeLiPalindrom

Aug 11th, 2015
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.29 KB | None | 0 0
  1.  
  2. #include<stdio.h>
  3.  
  4.  
  5. int palindrom (int n) {
  6.     int nb=0, cifra,pom=n;
  7.     while (n!=0) {
  8.             cifra=n%10;
  9.        nb=nb*10+cifra;
  10.        n/=10;
  11.     }
  12.     if (pom==nb) return 1;
  13.     return 0;
  14.     return nb;
  15. }
  16. int main () {
  17.     printf("%d",palindrom(123321));
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement