How to use % operator for float values in c

前端 未结 6 478
故里飘歌
故里飘歌 2020-12-03 14:30

When I use % operator on float values I get error stating that \"invalid operands to binary % (have ‘float’ and ‘double’)\".I want to enter the integers value only but the n

6条回答
  •  天涯浪人
    2020-12-03 15:29

    You can use the fmod function from the standard math library. Its prototype is in the standard header .

提交回复
热议问题