VOOZH about

URL: https://www.geeksforgeeks.org/cpp/valarray-sqrt-function-in-c/

⇱ valarray sqrt() function in C++ - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

valarray sqrt() function in C++

Last Updated : 24 Oct, 2018
The sqrt() function is defined in valarray header file. This function is used to calculate square root of the value of each element in valarray. Syntax:
sqrt(varr);
Parameter: This function takes a mandatory parameter varr which represents valarray. Returns: This function returns a valarray containing the square root of all the elements of valarray. Below programs illustrate the above function: Example 1:-
Output:
The new valarray with manipulated values is : 
2 4 5 6 7
Example 2:-
Output:
The new valarray with manipulated values is : 
2.23607 4 5.09902 6.08276 1
Comment
Article Tags: