Actually, your while loop isn't executing at all. newbalance is still equal to zero by the time the program reaches the while.