voilà mon code!
mon problème c'est que mon h=0, la question c'est comment je fait pour avoir h comme un nombre avec des nombre apés la virgulle.?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 #include<stdio.h> #include<math.h> #include<stdlib.h> int main() { double v,h,a,b,x; h=(b-a)/6; printf("doner a\n"); scanf("%lf",&a); printf("doner b\n"); scanf("%lf",&b); //f=cos(x); v=h*(cos(a)+4*cos((a+b)/2)+cos(b)); printf("intégrale(f,a,b)= %lf\n",h); }
merci.![]()
Partager