I am complete new to c programming. i ran this code to try to understand the order of precedence in c programming-
#include <stdio.h>
int main()
{
float sum = 8 / 4 * 2;
printf("\n the solution of the expression is %f", sum);
return 0;
}
for this code i am correcly getting the output 4.000000
however if i write the print statement as
printf("\n the solution of the expression is %f", 8 / 4 * 2);
i am getting the output as 0.000000. can anyone tell why does it give me different output for the same expression?