div_t - C stdlib.h

C examples for stdlib.h:div_t

Type

type

From


<cstdlib>
<stdlib.h>

Description

Structure returned by div

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

Members

quot         quotient
rem          remainder

Demo Code


#include <stdio.h>
#include <stdlib.h>

int main ()//ww w  .j  ava  2  s  .co m
{
  div_t divresult;
  divresult = div (8,5);
  printf ("8 div 5 => %d, remainder %d.\n", divresult.quot, divresult.rem);
  return 0;
}

Related Tutorials