invalid operands of types ‘float’ and ‘int’ to binary ‘operator%’
if(j%2==2)
why it is not possible ?
here, j is float
if this is it not possible tell me another way to write this statement ?
invalid operands of types ‘float’ and ‘int’ to binary ‘operator%’
if(j%2==2)
why it is not possible ?
here, j is float
if this is it not possible tell me another way to write this statement ?
Hi @anujsharmabadboy
acc to c++ standards % can be used only for intergral expression and not for float or double
u could use fmod(float1 , float2)
to evaluate the mod of float literals
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.