Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int prevrti(int broj) {
- if(broj == 0) {
- return 0;
- }
- static int sum = 0;
- int last_digit = broj % 10;
- sum = sum * 10 + last_digit;
- prevrti(broj / 10);
- return sum;
- }
- int main() {
- int N;
- scanf("%d", &N);
- printf("%d\n", prevrti(N));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement