Quotient and remainder for long : Divide « Math « C / ANSI-C






Quotient and remainder for long

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

int main(void)
{
  ldiv_t n;

  n = ldiv(10L, 3L);

  printf("Quotient and remainder: %ld %ld.\n", n.quot, n.rem);

  return 0;
}


           
       








Related examples in the same category

1.Quotient and remainder
2.Read int value and output the divide result
3. Divide two integer values: how to use div_t and div
4. Divide two long integer: how to use ldiv and ldiv_t