Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ab.cd each on \n
- #include <stdio.h>
- int main() {
- float num;
- int a, b, c, d;
- puts("Enter a 4 digit float");
- scanf_s("%f", &num);
- a = ((int)num) / 10;
- printf("%d\n", a);
- b = ((int)num % 10);
- printf("%d\n", b);
- c = ((int)(num * 10)) % 10;
- printf("%d\n", c);
- d = ((int)(num * 100)) % 10;
- printf("%d\n", d);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement