
Incorrect
Marks for this submission: 0/1.
Question 21
Marks: 1
The symbol for the stream insertion operator is ____________.
Choose one answer.
|
a. <<
|
|
|
b. & |
|
|
c. >> |
|
|
d. @ |
|
|
e. [ ] |
|
Correct
Marks for this submission: 1/1.
Question 22
Marks: 1
Storage-class
specifier
is
a recommendation to the compiler to store a variable in one of the
computer's registers.
Correct
Marks for this submission: 1/1.
Question 23
Marks: 1
Class members specified as _________ are accessible only to member functions of the class and friends of the class
Choose one answer.
|
a. public |
|
|
b. private
|
|
|
c. protected |
|
Correct
Marks for this submission: 1/1.
Question 24
Marks: 1
How would you output to an open file named a_file?
Choose one answer.
|
a. a_file<<"Output"; |
|
|
b. a_file.output( |
|
|
c. a_file="Output"; |
|
|
d. a_file.printf("Output"); |
|
|
e. a_file.out("Output"); |
|
Incorrect
Marks for this submission: 0/1.
Question 25
Marks: 1
Prompt the user
to enter an integer. End your prompting message with a colon (
followed by a space and leave the cursor positioned after the space.
Choose one answer.
|
a. std::cin << "Enter an integer: "; |
|
|
b. std::cout >> "Enter an integer: "; |
|
|
c. std::cout << "Enter an integer: \n"; |
|
|
d. std::cout << "Enter an integer: "< |
|
|
e. std::cout << "Enter an integer: ";
|
|
Correct
Marks for this submission: 1/1.
Question 26
Marks: 1
What is the output of the program? #include <iostream> using namespace std; int main() { int a = 1; do { cout << a; a+=2; } while (a<=5); return 0; }
Choose one answer.
|
a. 12345 |
|
|
b. 1234 |
|
|
c. 135
|
|
|
d. 13 |
|
|
e. 124 |
|
Correct
Marks for this submission: 1/1.
Question 27
Marks: 1
What is the value of x at the end of main? int main(int argc, char** argv) { int x = 50 % -7; return 0; }
Choose one answer.
|
a. -1 |
|
|
b. implementation defined |
|
|
c. undefined |
|
|
d. compiler error
|
|
|
e. 1 |
|