sum - cin >> temp; sum += temp; //product *= temp; }...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
# include <iostream> using namespace std; int main (void) { int number, sum = 0, temp; float average; //int product = 1; cout << "Enter the number of elements: "; cin >> number; for (int i = 1; i <= number; i++) { cout << "Enter a number: ";
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: cin >> temp; sum += temp; //product *= temp; } average = (float)sum/number; cout << "The sum is: " << sum << "\n"; cout << "The average is: " << average << "\n"; // cout << "The product is: " << product; return 0; }...
View Full Document

This note was uploaded on 04/24/2010 for the course COS 120 taught by Professor Bonev during the Fall '08 term at American University in Bulgaria.

Ask a homework question - tutors are online