C/stdlib.h/div


Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Creation of dynamic property PPDStack::$accum is deprecated in /var/www/cppe.ru/www/includes/parser/Preprocessor_DOM.php on line 803

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48
Материал из C\C++ эксперт
Перейти к: навигация, поиск

div: returns the quotient and the remainder in a structure of type div_t

    
//Declaration: div_t div(int numerator, int denominator); 

  #include <stdlib.h>
  #include <stdio.h>
  int main(void)
  {
    div_t n;
    n = div(10, 3);
    printf("Quotient and remainder: %d %d.\n", n.quot, n.rem);
    return 0;
  }
         
/*
Quotient and remainder: 3 1.
*/