correct 2025
Suppose that x and y are int variables, and z is a double variable. The input is:
28 32.6 12
Choose the values of x, y, and z after the following statement executes:
cin >> x >> y >> z; - correct answer x = 28, y = 32, z = 0.6
Consider the following program segment.
ifstream inFile; //Line 1
int x, y; //Line 2
... //Line 3
inFile >> x >> y; //Line 4
, Which of the following statements at Line 3 can be used to open the file
progdata.dat and input data from this file into x and y at Line 4? - correct
answer inFile.open("progdata.dat");
What is the output of the following statements?
cout << "123456789012345678901234567890" << endl
cout << setfill('#') << setw(10) << "Mickey"
<< setfill(' ') << setw(10) << "Donald"
<< setfill('*') << setw(10) << "Goofy" << endl; - correct answer
123456789012345678901234567890
####Mickey Donald*****Goofy
Suppose that x and y are int variables, ch is a char variable, and the input is:
4 2 A 12
Choose the values of x, y, and ch after the following statement executes:
cin >> x >> ch >> y; - correct answer This statement results in input failure