Advertisement
Josif_tepe

Untitled

May 12th, 2025
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.27 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. void print(int x) {
  6.     if(x > 5) {
  7.         return;
  8.     }
  9.     cout << x << endl;
  10.     print(x + 1);
  11. }
  12. int main() {
  13.     print(1);
  14.     return 0;
  15. }
  16. // print(1)
  17. // print(2)
  18. // print(3)
  19. // print(4)
  20. // print(5)
  21. // print(6);
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement