CPP MCQ
What is the use of apply() function in Valarray?
A)
Returns the summation of all elements of the Valarray
B)
Applies the manipulation provided to all the elements of the array
C)
Returns new array after shifting elements by the given number
D)
Returns new array after circular shifting elements by the given number

Correct Answer : Option (B) :   Applies the manipulation provided to all the elements of the array

Explanation : <Valarray> header provides apply() function to apply any manipulation passed to the function to all the elements in the Valarray.