arrays - numbers[index = index index The values in the...

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

View Full Document Right Arrow Icon
// Program Arrays manipulates values in an array. / #include <iostream> using namespace std; u int main () { const int MAX_ARRAY = 5; int numbers[MAX_ARRAY]; int index; int sum; // Stored values in the array. for (index = 0; index < MAX_ARRAY; index++)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: numbers[index] = index * index; // The values in the array are summed. sum = 0; for (index = 0; index <= MAX_ARRAY; index++) sum = sum + numbers[index]; cout << "Sum is " << sum << endl; return 0; } }...
View Full Document

Ask a homework question - tutors are online