Name

div function — Computes quotient and remainder

Synopsis

div_t div(int numerator, int denominator)
ldiv_t div(long numerator, long denominator)

The div function divides numerator by denominator and returns the quotient and the remainder in a structure.

Get C++ In a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.