C examples for stdlib.h:div_t
type
<cstdlib> <stdlib.h>
Structure returned by div
typedef struct { int quot; int rem; } div_t;
quot quotient rem remainder
#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; }