Update NumToWord.java

Changed do loop to a while so that the action does not occur until the condition is tested.