18 lines
368 B
C
18 lines
368 B
C
|
#include <stdio.h>
|
||
|
#include <stdlib.h>
|
||
|
#include <math.h>
|
||
|
|
||
|
int main(void) {
|
||
|
double res;
|
||
|
int resu;
|
||
|
int res1;
|
||
|
double res2;
|
||
|
printf("Entrez un réel : ");
|
||
|
scanf("%lf", &res);
|
||
|
res1 = res - trunc(res);
|
||
|
res1 = ceil(res1);
|
||
|
res2 = round(10*(ceil(res) - res));
|
||
|
printf("Chiffre des unités : %d",res1);
|
||
|
printf("Chiffre des dixièmes : %d",res2);
|
||
|
return EXIT_SUCCESS;
|
||
|
}
|