+ 1

What is the output of 5.0% 2

16th Feb 2022, 7:30 AM
Eric Njoroge Chege
5 Réponses
+ 8
Then c++ must only allow int % int
16th Feb 2022, 7:41 AM
Raul Ramirez
Raul Ramirez - avatar
+ 3
Thank you
16th Feb 2022, 7:52 AM
Eric Njoroge Chege
+ 2
You need to use fmod() function from <cmath> header to get remainder of floating point division. http://www.cplusplus.com/reference/cmath/fmod/
16th Feb 2022, 1:24 PM
Ipang
+ 1
Try it out. Let us know
16th Feb 2022, 7:34 AM
Raul Ramirez
Raul Ramirez - avatar
+ 1
After compiling,an error occurs
16th Feb 2022, 7:35 AM
Eric Njoroge Chege