+ 1
Pls guys i need help here, why didn't it also give my answer to the quotient?
4 Antworten
+ 1
Both a and b are integers. In this case a/b is an integer division, and it is between 0 and 1 so it is truncated to 0.
If you want to do a floating point division then at least one of the operands must be a float. You can do implicit conversion to float like this:
quo = (float)a/b;
+ 1
It's because both numbers are integers, so it also returns an integer. You should change one of the to float or double
+ 1
Thanks alot guys its working fine now 😊
0
So it would have been preferable to declear both a float