Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. {
  2. Program p = new Program();
  3.  
  4. int[] startingArray = new int[3];
  5. p.Recursion(startingArray,0);
  6. Console.Read();
  7. }
  8. private void Recursion(int[] array, int count)
  9. {
  10.  
  11. if (count == 2)
  12. {
  13. array[0] = 1;
  14. Console.WriteLine(array[0]);
  15. return;
  16. }
  17. else
  18. {
  19. count++;
  20. Recursion(array, count);
  21. }
  22. Console.WriteLine(array[0]);
  23. return;
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement