Created
June 3, 2017 12:01
-
-
Save devdilson/089f3351feeec2b561795537f3b3ede9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Recursion { | |
public static void main(String args[]) { | |
count(0, 101, 1); | |
} | |
public static void count(int start, int shouldBreakNum, int divisionResult) { | |
try { | |
System.out.println(start); | |
count(++start, --shouldBreakNum, start / shouldBreakNum); | |
} catch (ArithmeticException ex) {} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment