zoi20

Untitled

Jan 3rd, 2014
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.34 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int palindrom(int n)
  4. {
  5.     int cifra,novibroj=0;
  6.     while(n!=0)
  7.     {
  8.         cifra=n%10;
  9.         novibroj=novibroj*10+cifra;
  10.         n=n/10;
  11.     }
  12.     if (n==novibroj) return 1;
  13.     else return 0;
  14. }
  15. int main()
  16. {
  17.     int x;
  18.     scanf("%d",x);
  19.     printf("%d",palindrom(x));
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment