1) What is returned by max(min(10,5),6) ? 2) Write the line of code to display t
ID: 3554999 • Letter: 1
Question
1) What is returned by max(min(10,5),6)?
2) Write the line of code to display the backslash () to the console. Hint: The line starts with cout.
3) Fill in the blank in the following code so that the if statement tests whether a character ch is a numeric character.
if ( _____ )
cout << "It is a digit!" << endl;
4) Assume the string myName is declared as follows:
string myName = "Christopher";
What is returned by myName.at(1)?
5) Write the code that declares an output file stream (ofstream type) named myOutput and that uses the file named myOutput.txt as the output file. Hint: This can be done with either one or two lines of code.
6) Write the code that closes an input file stream (ifstream type) named myInput and that uses the file named myInput.txt as the input file. Hint: This is done with one line of code.
Explanation / Answer
1) 6
2) printf("\");
3) if(isdigit(ch))
4)h
5)ofstream myOutput;
myOutput.open(myoutput.txt);
6)
myInput.close(myInput.txt);
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.