Skip to content

Instantly share code, notes, and snippets.

@devdilson
Created June 3, 2017 12:01
Show Gist options
  • Save devdilson/089f3351feeec2b561795537f3b3ede9 to your computer and use it in GitHub Desktop.
Save devdilson/089f3351feeec2b561795537f3b3ede9 to your computer and use it in GitHub Desktop.
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