DEV/DEV1.1/TP11/tests.c
2024-09-30 15:02:16 +02:00

13 lines
347 B
C

# include <stdio.h>
# include <stdlib.h>
# include <math.h>
# define M_PI 3.14159265358979323846264338379
int main(void) {
double reel;
printf("Entrez un réel : ");
scanf("%lf", &reel);
printf("chiffre des unités : %d\n", (int) floor(reel) % 10);
printf("chiffre des dixièmes : %d\n", (int) floor(reel * 10) % 10);
return EXIT_SUCCESS;
}