I know this is a simple questions, but it came up when I was coding and I am wondering how it works now. So, my first question is that when printf is given an integer like b
You used the wrong format specifiers It should be
int a = 2, b = 5, result = 0; result = b/a*a; printf("%d\n", result); ... double a = 2, b = 5, result = 0; result = b/a*a; printf("%f\n", result);