C/After Decimal.c

18 lines
261 B
C
Raw Normal View History

2024-05-13 18:09:46 +02:00
#include <stdio.h>
#include <stdlib.h>
int main () {
float n, d; /* Full Number, Decimal */
int i; /* Integer */
printf("Enter decimal number: ");
scanf("%f", &n);
i = (int)n;
d = n - i;
printf("The number after the decimal is %f", d);
return 0;
}