http://en.cppreference.com/w/c/numeric/math/fmod
Alright, cool. There's this function called fmod
, but it appears to only work with float
, double
, and long double
. Is there a version of this function that works with integers in C++?
Yes, '%' is used for modulus operator, as Joducus said in the comment. See example.