C examples for stdlib.h:lldiv
function
<cstdlib> <stdlib.h>
Returns the integral division of numer by numer/denom as a structure of type lldiv_t, which has two members: quot and rem.
lldiv_t lldiv (long long int numer, long long int denom);
Parameter | Description |
---|---|
numer | Numerator. |
denom | Denominator. |
a lldiv_t structure, which has two members (in either order):
long long int quot; // quotient long long int rem; // remainder
#include <stdio.h> #include <stdlib.h> int main ()// w w w . j a v a 2s. c o m { lldiv_t res; res = lldiv (12331558149LL,3600LL); printf ("%lld R %lld .\n", res.quot, res.rem); return 0; }