You need to make cnt do something. sum_div needs to be initialized to zero. The "Continue? <Y/N>" loop needs some help.