Incorrect
Marks for this submission: 0/1.
Question 15
Marks: 1
The __________ operator reclaims memory previously allocated by new.
Choose one answer.
a. delete |
|
|
b. remove |
|
|
c. terminate |
|
|
d. clear |
|
|
e. execute |
|
Correct
Marks for this submission: 1/1.
Question 16
Marks: 1
Which header file do you need to include to use typecasting?
Choose one answer.
a. math.h |
|
|
b. None |
|
|
c. fstream.h |
|
|
d. ctype.h |
|
|
e. iostream.h |
|
Incorrect
Marks for this submission: 0/1.
Question 17
Marks: 1
What can be at output ? #include <iostream> using namespace std; int main(){ int a = 5; a = *&*&*&*&a; cout << *&*&*&*&a << " "; cout << &*&*&*&a << " "; return 0; }
Choose one answer.
a. 0x22ff74 5 |
|
|
b. 5 0x22ff74 |
|
|
c. 7 0x22ff82 |
|
|
d. 6 0x22ff78 |
|
Correct
Marks for this submission: 1/1.
Question 18
Marks: 1
A selection sort application would take approximately ________ times as long to run on a 128-element vector as on a 32-element vector.
Choose one answer.
a. 32, because an O(n2) algorithm takes 32 times as long to sort four times as much information |
|
|
b. 16, because an O(n2) algorithm takes 16 times as long to sort four times as much information |
|
Correct
Marks for this submission: 1/1.
Question 19
Marks: 1
Write a single statement that performs the specified task. Assume that floating-point variables number1 and number2 have been declared and that number1 has been initialized to 7.3. Assume that variable ptr is of type char *. Assume that arrays s1 and s2 are each 100-element char arrays that are initialized with string literals. Print the value of the object pointed to by fPtr.
Choose one answer.
a. cout << "The value of &fPtr is " << &fPtr << endl; |
|
|
b. cout << "The value of fPtr is " << fPtr << endl; |
|
|
c. cout << "The value of *fPtr is " << *fPtr << endl; |
|
Correct
Marks for this submission: 1/1.
Question 20
Marks: 1
What will !((1 || 0) && 0) evaluate to?
Choose one answer.
a. Wrong code |
|
|
b. Undefined behaviour |
|
|
c. 1 |
|
|
d. I don't know |
|
|
e. 0 |
|