Advertisement
elvman

Recursion

Nov 30th, 2014
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.18 KB | None | 0 0
  1. inline int recursive_test(int a)
  2. {
  3.     if (a > 0)
  4.     {
  5.         a += recursive_test(a - 1);
  6.     }
  7.  
  8.     return a;
  9. }
  10.  
  11. int main()
  12. {
  13.     printf("test: 0x%08x\n", recursive_test(10));
  14.  
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement