If try and catch are legal I would think it would be easy and fairly clean to recurse and then just divide by zero when you're done. Besides all that it always rocks when you get to divide by zero both for fun and profit.
public class Main {
public static void main(String[] args) {
count(100);
}
private static int count(int x) {
try {
int value=1/x;
count(x-1);
System.out.println(x);
}
catch (Exception e){
return 0;
}
return 1;
}