Question: Consider the program segment below: int k; // Looop control variable. int num; // Input value; ifstream inF(myFile.dat); // ... inF >> num; while (_____________________
Consider the program segment below:
int k; // Looop control variable.
int num; // Input value;
ifstream inF("myFile.dat"); //
...
inF >> num;
while (_____________________ ) <== THIS LINE *********
{
cout << num << ' ';
inF >> num;
}
Suppose the input file contains: 41 2 -34 56 -999 18 444 -1111
Suppose the output is: 41 2 -34 56
-----------
The code contains a while loop for reading inputs until a sentinel value
value is read.
DIRECTIONS: Write the while loop header [while(condition)] that must have
been used.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
