TZIVI-254: IVI needs a newer version of cmake
[profile/ivi/cmake.git] / Tests / Tutorial / Step1 / tutorial.cxx
1 // A simple program that computes the square root of a number
2 #include <stdio.h>
3 #include <stdlib.h>
4 #include <math.h>
5 #include "TutorialConfig.h"
6
7 int main (int argc, char *argv[])
8 {
9   if (argc < 2)
10     {
11     fprintf(stdout,"%s Version %d.%d\n",
12             argv[0],
13             Tutorial_VERSION_MAJOR,
14             Tutorial_VERSION_MINOR);
15     fprintf(stdout,"Usage: %s number\n",argv[0]);
16     return 1;
17     }
18   double inputValue = atof(argv[1]);
19   double outputValue = sqrt(inputValue);
20   fprintf(stdout,"The square root of %g is %g\n",
21           inputValue, outputValue);
22   return 0;
23 }