27 lines
386 B
C
27 lines
386 B
C
/* f(x) = sin(x) + ln(x) - sqrt(x) */
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <math.h>
|
|
|
|
float fonction_f(int);
|
|
|
|
int main() {
|
|
float f;
|
|
|
|
printf("x\tf(x)\n");
|
|
for (int i = 1; i <= 10; i++) {
|
|
f = fonction_f(i);
|
|
printf("%d\t%g\n", i, f);
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
float fonction_f(int x) {
|
|
float f;
|
|
|
|
f = sin(x) + log(x) - sqrt(x);
|
|
|
|
return f;
|
|
}
|