div

Calculates the quotient and remainder of an integer division.

Library:LibC
Classification:ANSI
Service:General C Services

Syntax

  #include <stdlib.h> 
   
  div_t div (
     int   numer,   
     int   denom);
  

Parameters

numer

(IN) Specifies the numerator.

denom

(IN) Specifies the denominator.

Return Values

Returns a structure of type div_t.

Remarks

The div_t structure has fields for the quotient and the remainder. It has the following syntax:

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

See Also

ldiv