diff --git a/TP1/E2.c b/TP1/E2.c index b5c6ff1..d6b707a 100644 --- a/TP1/E2.c +++ b/TP1/E2.c @@ -9,6 +9,6 @@ int main() { printf("Saisissez les coordonnées du point B sous la forme X,Y,Z\n"); scanf("%lf,%lf,%lf", &xb, &yb, &zb); double d = sqrt(pow(xb-xa, 2) + pow(yb-ya, 2) + pow(zb-za, 2)); - printf("AB = %lf\n", d); + printf("AB = %f\n", d); return 0; } diff --git a/TP1/E3.c b/TP1/E3.c index a21a308..e2a1738 100644 --- a/TP1/E3.c +++ b/TP1/E3.c @@ -11,15 +11,15 @@ int main() { printf("On a dit a≠0 !\n"); } else { double d = pow(b,2)-4*a*c; - printf("%lf\n", d); + printf("%f\n", d); if (d == 0) { - printf("x0 = %lf", -b/2*a); + printf("x0 = %f", -b/2*a); } else if (d > 0) { - printf("x1 = %lf; x2 = %lf", (-b+sqrt(d))/2*a, (-b-sqrt(d))/2*a); + printf("x1 = %f; x2 = %f", (-b+sqrt(d))/2*a, (-b-sqrt(d))/2*a); } else { double complex z1 = pow(b,2)/2*a + sqrt(-d)/2*a * I; double complex z2 = pow(b,2)/2*a - sqrt(-d)/2*a * I; - printf("z1 = %lf+i%lf; z2 = %lf+i%lf\n", creal(z1), cimag(z1), creal(z2), cimag(z2)); + printf("z1 = %f+i%f; z2 = %f+i%f\n", creal(z1), cimag(z1), creal(z2), cimag(z2)); } } diff --git a/TP1/E4.c b/TP1/E4.c index 61755de..e7bbd1f 100644 --- a/TP1/E4.c +++ b/TP1/E4.c @@ -9,6 +9,6 @@ int main() { for (k = 1; k <= n; k++) { s += 1/k; // Si k avait été un entier, 1/k aurait été un entier aussi (0) } - printf("%lf\n", s); + printf("%f\n", s); return 0; } diff --git a/TP1/E6.c b/TP1/E6.c index 06e1dd1..f09ce96 100644 --- a/TP1/E6.c +++ b/TP1/E6.c @@ -21,8 +21,8 @@ int main() { x = a; for (j = 1; j <= jmax; j++) { x = (x + a/x)/2; - printf("La %dème approximation de la racine carrée de %lf est %lf.\n", j, a, x); + printf("La %dème approximation de la racine carrée de %f est %f.\n", j, a, x); } - printf("%lf\n", x); + printf("%f\n", x); return 0; }