Square root in C++ can be calculated using sqrt() function defined in math.h header file. This function takes a number as an argument and returns the square root of that number.
可以使用math.h标头文件中定义的sqrt()函数来计算C ++中的平方根 。 此函数以数字作为参数,并返回该数字的平方根。
Below I have shared a program to find square root in C++. If you have any problem then you can freely ask it by commenting below.
下面我共享了一个程序来查找C ++中的平方根。 如果您有任何问题,可以通过下面的评论随意提出。
C ++中的平方根程序 (Program for Square Root in C++)
#include<iostream>
#include<math.h>
using namespace std;
int main()
{
float sq,n;
cout<<"Enter any number:";
cin>>n;
sq=sqrt(n);
cout<<"Square r