initial import
[staff/goc4/2018bti7061.git] / c-7-compilation / examples / autotools / exercise1logarithm.c
1 #include <stdio.h>
2 #include "myLib.h"
3
4 int main(int argc, char* argv[]){
5 if(argc !=2) goto error;
6
7 long int arg1;
8 int scan_res = sscanf(argv[1]," %ld", &arg1);
9 if(scan_res != 1) goto error;
10
11 long result = logarithm(arg1);
12
13 printf("Decimal log(%ld)=%ld\n",arg1,result);
14
15 return 0;
16
17
18 error:
19 printf("Usage \n exercise1logarithm <number>\n");
20
21 }