Test Series - cpp

Test Number 85/102

Q: What is meant by sequence point?
A. Represent the point of execution in the program
B. Represent the whole program
C. Represent the beginning of the programRepresent the beginning of the program
D. Represent the end of the program
Solution: A sequence point defines any point in a computer program’s execution at which it is guaranteed that all side effects of previous evaluations have been performed.
Q: Pick out the correct statement about sequence point.
A. Sequence point will compile the program
B. Sequence point will resolve all the side effects
C. Sequence point will save the program for execution
D. Sequence point will delete the program for execution
Solution: Sequence point is a point in time at which the dust has settled and all side effects which have been seen so far are guaranteed to be complete.
Q: In sequence point, how will the overloaded operators behave like?
A. Function
B. Objects
C. Instance variable
D. Container
Solution: In sequence point, the overloaded operators behave like a function.
Q: What do input and output objects support?
A. Terminated sequences
B. Extracted sequences
C. Null-terminated sequences
D. Terminated & Extracted sequences
Solution: cin and cout support null-terminated sequences as valid containers for sequences of characters.
Q: What kind of execution does sequence point allow?
A. Non-overlap
B. Overlap
C. Concurrent
D. Sequence
Solution: To resolve all the side-effects in the program, the sequence point should not be overlapped.
Q: When does the next sequence point start?
A. At the beginning
B. After a terminating semicolon
C. It is a beginning statement
D. At the end
Solution: After a terminating semicolon the next sequence point start.
Q: What is meant by heap?
A. Used for fast retrieval of elements
B. Used for organising the elements
C. Used for fast retrieval & organising the elements
D. Used for deleting the elements
Solution: A heap is a way to organize the elements of a range that allows for fast retrieval of the element.
Q: Which value is pointed out first in heap?
A. Lowest value
B. Highest value
C. First value
D. Third value
Solution: The element with the highest value is always pointed by first.
Q: Which operator is used to compare the elements in heap?
A. >>
B. comp
C. <
D. Both comp &<
Solution: The elements in the heap are compared using operator< (for the first version), or comp (for the second version).
Q: In what form does the STL provides heap?
A. queue
B. list
C. vector
D. priority_queue
Solution: STL does provide a heap in the form of a std::priority_queue.

You Have Score    /10