ldiv_t ldiv (long int numer, long int denom);
numer/denom
12
long int quot; // quotient long int rem; // remainder
1234567891011
/* ldiv example */ #include <stdio.h> /* printf */ #include <stdlib.h> /* ldiv, ldiv_t */ int main () { ldiv_t ldivresult; ldivresult = ldiv (1000000L,132L); printf ("1000000 div 132 => %ld, remainder %ld.\n", ldivresult.quot, ldivresult.rem); return 0; }
1000000 div 132 => 7575, remainder 100.