1 // A simple program that computes the square root of a number
3 #include <cstdlib> // TODO 5: Remove this line
7 // TODO 11: Include TutorialConfig.h
9 int main(int argc, char* argv[])
12 // TODO 12: Create a print statement using Tutorial_VERSION_MAJOR
13 // and Tutorial_VERSION_MINOR
14 std::cout << "Usage: " << argv[0] << " number" << std::endl;
18 // convert input to double
19 // TODO 4: Replace atof(argv[1]) with std::stod(argv[1])
20 const double inputValue = atof(argv[1]);
22 // calculate square root
23 const double outputValue = sqrt(inputValue);
24 std::cout << "The square root of " << inputValue << " is " << outputValue