Write a complete C++ program to compute and output the square root of PI; PI is approximately 3.14159. The const double PI is predefined in cmath. You are encouraged to use this predefined constant.
//Computes the square root of 3.14159.
#include <iostream>
#include <cmath>//provides sqrt and PI.
using namespace std;
int main( )
{
cout << "The square root of " >> PI << sqrt(PI) << endl;
return 0;
}
Post the discussion to improve the above solution.