invalid operands of types int and double to binary 'operator%'

前端 未结 3 795
南方客
南方客 2021-01-03 21:29

After compiling the program I am getting below error

invalid operands of types int and double to binary \'operator%\' at line 
\"newnum1 = two % (double)10.0         


        
3条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-03 21:59

    Because % only works with integer types. Perhaps you want to use fmod().

提交回复
热议问题