lldiv - C stdlib.h

C examples for stdlib.h:lldiv

Type

function

From


<cstdlib>
<stdlib.h>

Description

Returns the integral division of numer by numer/denom as a structure of type lldiv_t, which has two members: quot and rem.

Prototype

lldiv_t lldiv (long long int numer, long long int denom);

Parameters

Parameter Description
numer Numerator.
denom Denominator.

Return Value

a lldiv_t structure, which has two members (in either order):

long long int quot;   // quotient
long long int rem;    // remainder

Demo Code


#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;
}

Related Tutorials