Fin du TP12
This commit is contained in:
13
DEV1.1/TP11/tests.c
Normal file
13
DEV1.1/TP11/tests.c
Normal file
@@ -0,0 +1,13 @@
|
||||
# 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;
|
||||
}
|
Reference in New Issue
Block a user