Advertisement
Josif_tepe

Untitled

May 25th, 2021
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.41 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. void pecati(int broj) {
  5.     if(broj > 10) { // ne pecatime broevi koi se pogolemi od 10
  6.         return;
  7.     }
  8.     printf("%d ", broj);
  9.     pecati(broj + 1);
  10. }
  11. int main() {
  12.     pecati(1);
  13.    
  14.     return 0;
  15. }
  16.  
  17. // pecati(1)
  18. // pecati(2)
  19. // pecati(3)
  20. // pecati(4)
  21. // pecati(5)
  22. // pecati(6)
  23. // pecati(7)
  24. // pecati(8)
  25. // pecati(9)
  26. // pecati(10)
  27. // pecati(11)
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement