Modify program to call puts only one time even if a negative number is given.