Armstrong number generator
The first number is included in the range but the last number is not. That inconsistency is odd. You should document the limitations you set to the input. If your limitations make documentation hard, it's a sign of bad programming.

Knowing what I wrote above, right now you to check for both equality and greater than between firstNumber and lastNumber. Just check if (firstNumber &gt; lasNumber) instead and tell the user that "firstNumber must be smaller than lastNumber."

FirstNumber and lastNumber are not descriptive variable names. LowerLimit and upperLimit would be better.

You're not prepared for negative input.

Using firstNumber as both the lower limit and loop counter makes the variable name to be incorrect in both uses. It's really never the lowerLimit nor the number being checked. Add a separate variable and use a loop for (int candidate = lowerLimit; candidate &lt;= upperLimit; candidate++) { ...

You should separate the algorithm from main method that reads the input to a static utility method that operates on integers. Reading code that is nested four deep is difficult.