Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <algorithm>
- #include <vector>
- using namespace std;
- void print(int x) {
- if(x > 10) {
- return;
- }
- cout << x << endl;
- print(x + 1);
- }
- int main() {
- print(1);
- return 0;
- }
- // print(1)
- // print(2)
- // print(3)
- // print(4)
- // print(5)
- // print(6)
- // print(7)
- // print(8)
- // print(9)
- // print(10)
- // print(11) --> return / end of recursion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement