1 // A simple program that computes the square root of a number
7 int main(int argc, char* argv[])
10 std::cout << "Usage: " << argv[0] << " number" << std::endl;
14 // convert input to double
15 const double inputValue = atof(argv[1]);
17 // calculate square root
18 const double outputValue = sqrt(inputValue);
19 std::cout << "The square root of " << inputValue << " is " << outputValue