div

Calculate the quotient and remainder.

div_t div (int n, int d);

Required Header
<stdlib.h>

Return Value

This function returns a structure containing the quotient and remainder integer values.

Parameters

n

  Number

d

  Denominator

Remarks

The div function returns a structure of the form:

typedef struct {
    int quot;
    int rem;
} div_t;

Standard Library

See Also    ldiv