18 lines
371 B
C
18 lines
371 B
C
|
#include<stdio.h>
|
||
|
#include<stdlib.h>
|
||
|
#include<math.h>
|
||
|
|
||
|
int main(int argc, char * argv[]) {
|
||
|
double x;
|
||
|
printf("Veuillez donner un réel : ");
|
||
|
scanf("%lf", &x);
|
||
|
|
||
|
int partie_entiere = (int)trunc(x) % 10;
|
||
|
int dixieme = (int)trunc(x*10) % 10;
|
||
|
|
||
|
printf("Chiffre des unités : %d\n", partie_entiere);
|
||
|
printf("Chiffre des dixieme : %d\n", dixieme);
|
||
|
return EXIT_SUCCESS;
|
||
|
}
|
||
|
|