Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- { int numero, x, y, z, w, t;
- do{
- printf("Digite um numero de cinco digitos:\n");
- scanf ("%d",&numero);
- }while (numero < 10000 || numero > 99999);
- system("cls");
- x = numero % 10;
- y =(numero % 100 - x) / 10;
- z =(numero % 1000 - x - y * 10) / 100;
- w =(numero % 10000 - x - y * 10 - z * 100) / 1000;
- t =(numero % 100000 - x - y * 10 - z * 100 - w * 1000) / 10000;
- if ((x == t) && (y == w))
- printf ("Este numero eh palindromo.\n");
- else printf ("Este numero nao eh palindromo.\n");
- return 0;
- }
Add Comment
Please, Sign In to add comment