+ 1

# How to write mathematical functions in c++?

2 Answers

+ 18

Which kind of functions? If you mean power, square root, absolute value, trigonometric functions etc., then there are library functions to calculate these.
See this reference:
http://www.cplusplus.com/reference/cmath/

+ 2

you can use function of math.h to carry out operations like square root, sin, cos, tan etc.
e.g. to calculate square root use sqrt(num) or to raise a number to power use pow(num, exponent);