09/16/09 – Program I


Write a program that keeps prompting the user to enter positive integers. The user signals that he or she is done by entering a negative number like -1. The program then prints out how many numbers were entered, their sum and average. If the user does not enter any number, [i.e. the first number the user enters is -1], then your program should not do a division by zero to obtain the average.

My Solution


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: