SHARE
TWEET

Recursion

a guest Feb 21st, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. void RecursiveAddition(int &number)
  6. {
  7.     number += 1;
  8.     if (number < 10) {
  9.         RecursiveAddition(number);
  10.     }
  11. }
  12.  
  13. int main()
  14. {
  15. int number = 0;
  16.  
  17. RecursiveAddition(number);
  18. cout << number << endl;
  19. return 0;
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top