

MCQOPTIONS
Saved Bookmarks
This section includes 9 Mcqs, each offering curated multiple-choice questions to sharpen your C++ Programming knowledge and support exam preparation. Choose a topic below to get started.
1. |
Which function is used to print the maximum element from Valarray? |
A. | change() |
B. | min() |
C. | swap() |
D. | max() |
Answer» E. | |
2. |
Which function is used to swap two Valarray? |
A. | max() |
B. | min() |
C. | swap() |
D. | change() |
Answer» D. change() | |
3. |
Which of the following is correct about the shift? |
A. | Returns new array after shifting elements by the given number |
B. | Shifts the elements towards left if the argument supplied is positive |
C. | Shifts the elements towards the right if the argument supplied is negative |
D. | All of the mentioned |
Answer» E. | |
4. |
What is the function of shift()? |
A. | Applies the manipulation provided to all the elements of the array |
B. | Returns the summation of all elements of Valarray |
C. | Returns new array after shifting elements by the given number |
D. | Returns new array after circular shifting elements by the given number |
Answer» D. Returns new array after circular shifting elements by the given number | |
5. |
What is the use of sum() function in Valarray? |
A. | Applies the manipulation provided to all the elements of the array |
B. | Returns the summation of all elements of Valarray |
C. | Returns new array after shifting elements by the given number |
D. | Returns new array after circular shifting elements by the given number |
Answer» C. Returns new array after shifting elements by the given number | |
6. |
What is the use of apply() function in Valarray? |
A. | Returns new array after shifting elements by the given number |
B. | Returns the summation of all elements of the Valarray |
C. | Applies the manipulation provided to all the elements of the array |
D. | Returns new array after circular shifting elements by the given number |
Answer» D. Returns new array after circular shifting elements by the given number | |
7. |
Which header file is required for using Valarray? |
A. | <array> |
B. | <Valarray> |
C. | <stl> |
D. | <algorithm> |
Answer» C. <stl> | |
8. |
Which of the following is correct about Valarray? |
A. | Supports element-wise mathematical operations |
B. | Slower than a normal array |
C. | Harder to use |
D. | Can have only integer Valarrays |
Answer» B. Slower than a normal array | |
9. |
What is Valarray in C++? |
A. | Container for efficient operations on an array |
B. | Container for efficient printing of the array |
C. | Container for efficient value conversion of array |
D. | Container for efficient type conversion of array |
Answer» B. Container for efficient printing of the array | |