Divide two long integer: how to use ldiv and ldiv_t : Divide « Math « C / ANSI-C






Divide two long integer: how to use ldiv and ldiv_t



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

int main ()
{
  ldiv_t divresult;
  
  divresult = ldiv (635537,189);
  
  printf ("635537 / 189 = %d ( %d", divresult.quot, divresult.rem);
  
  return 0;
}

           
       








Related examples in the same category

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