Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int nr, ok, c, nr_invers, aux;
- scanf("%d", &nr);
- nr_invers = 0;
- aux = nr;
- while(nr != 0)
- {
- c = nr % 10;
- nr_invers = nr_invers*10 + c;
- nr = nr / 10;
- }
- nr = aux;
- if(nr == nr_invers)
- {
- printf("Este palindrom!\n");
- }
- else
- {
- printf("Nu este palindrom!\n");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment