Back to index

glibc  2.9
Functions
testdiv.c File Reference
#include <stdlib.h>
#include <stdio.h>

Go to the source code of this file.

Functions

int main (void)

Function Documentation

int main ( void  )

Definition at line 23 of file testdiv.c.

{
  int err = 0;
  int i, j;
  while (scanf ("%d %d\n", &i, &j) == 2)
    {
      div_t d = div (i, j);
      printf ("%d / %d = %d + %d/%d", i, j, d.quot, d.rem, j);
      if (i == d.quot * j + d.rem)
       fputs ("  OK\n", stdout);
      else
       {
         fputs ("  FAILED\n", stdout);
         err = 1;
       }
    }
  return err;
}

Here is the call graph for this function: