Fundamentals9 / 16
Up next

Integer and real division

#include <stdio.h>

int main(void) {
    int a = 7, b = 2;
    printf("%d %d %d\n", a + b, a - b, a * b);
    printf("%d %.3f\n", a / b, (double)a / b);
    return 0;
}
What you're solving

int truncates, cast for real division