>and as spoon wrote the right way on C++ but you need to add a nother header file which is cmath.h or math.h
Or <cmath>. But believe it or not, the expression was correct for C as well. Of course, in C you would have to include <math.h>.