Iam new to C programming and i guess this question might look foolish but I have searched and i didn't get a satisfactory answer:
My question is does hierachy of execution of operators depend on whether the declared variables are integer or float, here is a scenario which I don't understand; this is the first case:
main()
{
int i=2,j=3,k;
k=i/j*j;
printf("%d",k);
and the output to that is 0
which i don't agree with;
But when I change the variables to float as in below;
main()
{
float i=2,j=3,k;
k=i/j*j;
printf("%f",k);
The output to becomes 2.00000
why is this?