//-------------------------------------------------------------------- // arrayio.cpp // program to illustrate the use of input and output with arrays // //-------------------------------------------------------------------- // Reads six integers into array polLevel and displays them to // the screen three per line.#include <iostream.h> void main() { int polLevel[6]; // Array of six pollution level readings int j; // Loop counter // Input six integers into the pollution level array. cout << "Enter the six pollution level readings:"; for ( j = 0; j < 6; j++ ) cin >> polLevel[j]; // Display the readings three values per line. for ( j = 0; j < 6; j++ ) { if ( j % 3 == 0 ) cout << endl; cout << polLevel[j] << " "; } cout << endl; }