diff options
Diffstat (limited to 'Help/guide/tutorial/Step2/tutorial.cxx')
-rw-r--r-- | Help/guide/tutorial/Step2/tutorial.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Help/guide/tutorial/Step2/tutorial.cxx b/Help/guide/tutorial/Step2/tutorial.cxx index f2ab446..53b0810 100644 --- a/Help/guide/tutorial/Step2/tutorial.cxx +++ b/Help/guide/tutorial/Step2/tutorial.cxx @@ -15,9 +15,11 @@ int main(int argc, char* argv[]) return 1; } - double inputValue = std::stod(argv[1]); + // convert input to double + const double inputValue = std::stod(argv[1]); - double outputValue = sqrt(inputValue); + // calculate square root + const double outputValue = sqrt(inputValue); std::cout << "The square root of " << inputValue << " is " << outputValue << std::endl; return 0; |