Test Series - cpp

Test Number 98/102

Q: Which of the following library is used to do vector arithmetic?
A. Boost
B. Time
C. OpenGL
D. OpenDL
Solution: Boost package has a linear algebra package that may well suits for vector arithmetic.
Q: Which header file is used to manipulate the vector algebra in c++?
A. math
B. cmath
C. vmath
D. dmath
Solution: vmath is set of C++ classes for Vector and Matrix algebra used in the programs.
Q: What type of reference should be used in vector arithmetic?
A. dynamic
B. const
C. both dynamic & const
D. static
Solution: As we are using the vector and it will give accurate result if we use const reference.
Q: Which function is used to optimize the space in vector?
A. at
B. bool
C. operator
D. operand
Solution: This is a specialized version of vector, which is used for elements of type bool and optimizes for space.
Q: What is the use of vector arithmetic in c++?
A. Computer graphics
B. Computer booting
C. Both Computer graphics & Computer booting
D. Computer Networks
Solution: Computer graphics is the use of vector arithmetic in c++.
Q: Which header file is used to operate on numeric sequences?
A. number
B. numeric
C. algorithm
D. digit
Solution: header file is used to operate on numeric sequences that support certain operations.
Q: Which mathematics library is used for vector manipulation in c++?
A. cli++
B. vec++
C. blitz++
D. stac+++
Solution: Blitz++ is a high-performance vector mathematics library written in C++.
Q: What is the use of accumulate function in a numeric library?
A. Returns the number
B. Returns the result of accumulating all the values in the range
C. Returns the number & result
D. Return the characters
Solution: Returns the result of accumulating all the values in the range from first to last.
Q: How many parameters are available in partial_sum function in c++?
A. 2
B. 3
C. 2 or 3
D. 3 or 4
Solution: There are three or four parameters available in partial_sum function in C++. They are first and last element, result and an optional binary operator.
Q: What is the default operation of adjacent_difference function in numeric library?
A. Difference
B. Addition
C. Multiplication
D. Subtraction
Solution: The default operation is to calculate the difference, but some other operation can be specified as binary operator instead.

You Have Score    /10