diff --git a/SimpleExecutable/hello.h b/SimpleExecutable/hello.h deleted file mode 100644 index a81e8c0..0000000 --- a/SimpleExecutable/hello.h +++ /dev/null @@ -1,3 +0,0 @@ -#include - -void hello(); diff --git a/SimpleExecutable/main.cc b/SimpleExecutable/main.cc index 76a9e99..9369f09 100644 --- a/SimpleExecutable/main.cc +++ b/SimpleExecutable/main.cc @@ -3,8 +3,6 @@ #include #include -// #include "hello.h" - int main (int argc, char *argv[]) { if (argc < 2) @@ -13,9 +11,17 @@ int main (int argc, char *argv[]) return 1; } double inputValue = atof(argv[1]); - double outputValue = sqrt(inputValue); - fprintf(stdout,"The square root of %g is %g\n", - inputValue, outputValue); + double outputValue = sqrt(abs(inputValue)); + if ( inputValue >= 0. ) + { + fprintf(stdout,"The square root of %g is %g\n", + inputValue, outputValue); + } + else + { + fprintf(stdout,"The square root of %g is %g x i\n", + inputValue, outputValue); + } // hello(); return 0;