how to use the sqrt function c++ code example Example 1: sqrt in c++ #include <cmath> sqrt(x); Example 2: sqrt c++ #include <math.h>