#include <stdlib.h>
ldiv_t ldiv(long int numerator, long int denominator);
The ldiv() function calculates the quotient and remainder of the division of numerator by denominator.
The ldiv() function returns a structure of type ldiv_t, containing both the quotient long int quot and the remainder long int rem.
If the value cannot be represented, the returned value is undefined. If denominator is 0, a divide by 0 exception is raised.