int a=98, b=10;
float c;
c=a/b;
Output: c=9
I know because of implicit type conversion, c
value is 9 not 9.8 but then I encountered this question:
int a,b,c,d;
a=40;
b=35;
c=20;
d=10;
printf("%d",a*b/c-d);
output: 60
Now if we see the precedence for equation is right to left and according to BODMAS rule b/c(35/20) will be performed first so 35/20 = 1.75 and then implicit conversion to integer make it to 1 and then rest will follow up the answer must be 30 but the output is 60 which is correct answer. Can you explain me why?