|
divfunction
<cstdlib> div_t div ( int numerator, int denominator ); ldiv_t div ( long numerator, long denominator ); Integral division Returns the integral quotient and remainder of the division of numerator by denominator as a structure of type div_t or ldiv_t, which has two members: quot and rem.Parameters
Return ValueThe result is returned by value in a structure defined in <cstdlib>, which has two members. For div_t, these are, in either order:int quot; int rem; and for ldiv_t: long quot; long rem; PortabilityIn C, only the int version exists.Example
Output:
See also
|