Practice Quiz 2 - Input and Output Streams There are 10 questions in this quiz Question 1: Multiple Choice Which statement about the preprocessor is FALSE? it can includes files indicated by the #include directive it replaces constants with their real values it compiles source code it runs before the compiler Question 2: Multiple Choice The #include directive:- indicates a file to be included in the program indicates that parts of the source code should not be compiled indicates which parts of the source code should be compiled includes a constant value Question 3: Multiple Choice When angle brackets are used with the #include directive, this indicates:- the file to be included can be located in the project folder the file is to be excluded when compiling the file will be written at at a later point the file to be included can be located in default folder for .H files Question 4: Multiple Choice Which of the following directives is involved in the creation of a constant? #include #endif #define #import Question 5: Multiple Choice The function main() is special because:- it is automatically executed when a program is first run it returns a value it is the only function that doesn't have to return a value it returns an integer value Question 6: Multiple Choice When the function main() is declared as follows:- void main() What type of value is returned? int float void no value Question 7: Multiple Choice Which statement about the cin function is TRUE? it can be used to capture input from a console it can be used to send output to a console it can be used to capture input from textboxes it is only used with the C programming language and not C++ Question 8: Multiple Choice The special escape characters \t indicates to the function cin:- a new line the F1 key was pressed a tab character the ESC key was pressed Question 9: Multiple Choice Which of the following is a valid set of escape characters? endl \n \r \t \\ \a \” \’ endl \n \r \t \\ \a ” ’ endl /n /r /t endl \n \r \t \u \v \w \y Question 10: Multiple Choice What sort of error will the following code produce? void main() { return 0; } a run-time error a linker error no error, the code is fine a compiler error
There are 10 questions in this quiz
Which statement about the preprocessor is FALSE? it can includes files indicated by the #include directive it replaces constants with their real values it compiles source code it runs before the compiler
Which statement about the preprocessor is FALSE?
The #include directive:- indicates a file to be included in the program indicates that parts of the source code should not be compiled indicates which parts of the source code should be compiled includes a constant value
The #include directive:-
When angle brackets are used with the #include directive, this indicates:- the file to be included can be located in the project folder the file is to be excluded when compiling the file will be written at at a later point the file to be included can be located in default folder for .H files
When angle brackets are used with the #include directive, this indicates:-
Which of the following directives is involved in the creation of a constant? #include #endif #define #import
Which of the following directives is involved in the creation of a constant?
The function main() is special because:- it is automatically executed when a program is first run it returns a value it is the only function that doesn't have to return a value it returns an integer value
The function main() is special because:-
When the function main() is declared as follows:- void main() What type of value is returned? int float void no value
When the function main() is declared as follows:-
void main()
What type of value is returned?
Which statement about the cin function is TRUE? it can be used to capture input from a console it can be used to send output to a console it can be used to capture input from textboxes it is only used with the C programming language and not C++
Which statement about the cin function is TRUE?
The special escape characters \t indicates to the function cin:- a new line the F1 key was pressed a tab character the ESC key was pressed
The special escape characters \t indicates to the function cin:-
Which of the following is a valid set of escape characters? endl \n \r \t \\ \a \” \’ endl \n \r \t \\ \a ” ’ endl /n /r /t endl \n \r \t \u \v \w \y
Which of the following is a valid set of escape characters?
What sort of error will the following code produce? void main() { return 0; } a run-time error a linker error no error, the code is fine a compiler error
What sort of error will the following code produce?
void main() {
return 0;
}