Loading color scheme

C++ Math Functions
cpp_math
C++ has many mathematical library functions that allow you to perform math tasks on integer, float and double-precision numbers.
Max and min

The max(x,y) function can be used to find the highest value of x and y:

Example

cout << max(1, 2);

Prints “2”

And the min(x,y) function can be used to find the lowest value of of x and y:

Example

cout << min(1, 2);

Prints “1”

Read more
Get all interesting articles to your inbox
Please wait