initial import
[staff/goc4/2018bti7061.git] / c-1-basics / examples / operatorsC / library2.c
1 #include <stdio.h>
2 #include <math.h>
3
4 main(){
5 float x, y;
6 double logX;
7 double xPowerY;
8 int iX,iY;
9 // stdio.h
10 puts("Type an integer x?");
11 char xsadfsda = scanf("%f",&x); // argument is address of x
12 puts("Type an integer y?");
13 char yasfsadf = scanf("%f",&y); // address of y
14
15 logX = log(x)/log(2); // since log(x) is the natural logarithm
16
17 printf("Log of %f = %lf \n",x,logX);
18
19 xPowerY = pow(x,y);
20 printf("%f power %f = %lf \n",x,y,xPowerY);
21
22
23 }