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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!