Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- void rekurzija(int x) {
- if(x > 5) {
- return;
- }
- rekurzija(x + 1);
- printf("%d ", x);
- }
- int main() {
- rekurzija(1);
- return 0;
- }
- /*
- rekurzija(1) --> rekurzija(2) | print(1)
- rekurzija(2) --> rekurzija(3) | print(2)
- rekurzija(3) --> rekurzija(4) | print(3)
- rekurzija(4) --> rekurzija(5) | print(4)
- rekurzija(5) --> rekurzija(6) | print(5)
- rekurzija(6) -->
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement