+ 1
How to find the square root of any number?
2 Antworten
+ 8
Or, if you don't want to include the whole module just for the sqrt function, you might calculate it by taking it to the power of 0.5:
81**.5 = 9.0, as 9**2 = 81
+ 2
You have to include the Math headerfile. THis includes the Math class with its sqrt(double a)-Method.
For example:
#include <iostream>
#include <Math.h>
double a, result;
a = 9.0;
result = Math.sqrt(a);
std::cout<<result;