// pgm26 // 11/7/2016 // partially filled arrays // WITH a while loop. Program counts how many data elts // are being entered. #include #include using namespace std; const int SIZE=25; int main() { // allocate an array of size SIZE int idnums[SIZE], numelts=0; cout << "Enter id number, -1 to finish: " << endl; cin >> idnums[numelts]; // numelts is 0 // read in the values into the array while (idnums[numelts] != -1) { // Process previous elt (display data) cout << "You entered: " << idnums[numelts] << ' '; numelts++; // structured read loop (read in the next piece of data cout << "Enter id number, -1 to finish: " << endl; cin >> idnums[numelts]; } cout << "You entered " << numelts << " elements. " << endl; cout << "Here is the array: " << endl; for (int i=0; i