#include#include using namespace std; int main() { double number = 25.0; double squareRoot = sqrt(number); cout << "The square root of " << number << " is " << squareRoot << endl; return 0; }
#includeOutput: Enter a number: 36 The square root of 36 is 6. In both examples, the std sqrt function is used to calculate the square root of a given number. The cmath package library is included to use this function.#include using namespace std; int main() { double number; cout << "Enter a number: "; cin >> number; double squareRoot = sqrt(number); cout << "The square root of " << number << " is " << squareRoot << endl; return 0; }