Guest User

Untitled

a guest
Dec 7th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #include <stdio.h>
  2. int main()
  3. { int numero, x, y, z, w, t;
  4. do{
  5. printf("Digite um numero de cinco digitos:\n");
  6. scanf ("%d",&numero);
  7. }while (numero < 10000 || numero > 99999);
  8. system("cls");
  9. x = numero % 10;
  10. y =(numero % 100 - x) / 10;
  11. z =(numero % 1000 - x - y * 10) / 100;
  12. w =(numero % 10000 - x - y * 10 - z * 100) / 1000;
  13. t =(numero % 100000 - x - y * 10 - z * 100 - w * 1000) / 10000;
  14.  
  15. if ((x == t) && (y == w))
  16. printf ("Este numero eh palindromo.\n");
  17. else printf ("Este numero nao eh palindromo.\n");
  18. return 0;
  19. }
Add Comment
Please, Sign In to add comment