Scroll Down to See All
abortabsacosasctimeasctime_rasinassertatanatan2atexitatofatoiatolbsearchbtowccalloccatclosecatgetscatopenceilclearerrclockcoscoshctimectime_rdifftimeerferfcexitexpfabsfclosefdopenfeofferrorfflushfgetcfgetposfgetsfgetwcfgetwsfopenfprintffputcfputwsfreadfreefreopenfrexpfscanffseekfsetposftellfwidefwprintffwritefwscanfgetcgetchargetenvgetwcgetwchargmtimegmtime_rhypotisalnumisalphaisasciiisblankiscntrlisdigitisgraphislowerisprintispunctisspaceisupperiswalnumiswalphaiswblankiswcntrliswctypeiswdigitiswgraphiswloweriswprintiswpunctiswspaceiswupperiswxdigitisxdigitj0j1jnlabsldexpldivlocaleconvlocaltimelocaltime_rloglog10longjmpmallocmblenmbrlenmbrtowcmbsinitmbsrtowcsmbstowcsmbtowcmemchrmemcmpmemcpymemmovememsetmktimemodfnextafternextafterlnexttowardnexttowardlnl_langinfoperrorpowprintfputcputcharputenvputsputwcputwcharqsortquantexpd32quantexpd64quantexpd128quantized32quantized64quantized128samequantumd32raiserandrand_rreallocregcompregerrorregexecregfreeremoverenamerewindscanfsetbufsetjmpsetlocalesetvbufsignalsinsinhsnprintfsprintfsqrtsrandsscanfstrcasecmpstrcatstrchrstrcmpstrcollstrcpystrcspnstrerrorstrfmonstrftimestrlenstrncasecmpstrncatstrncmpstrncpystrpbrkstrptimestrrchrstrspnstrstrstrtodstrtod32strtod64strtod128strtofstrtokstrtok_rstrtolstrtoldstrtoulstrxfrmswprintfswscanfsystemtantanhtimetime64tmpfiletmpnamtoasciitolowertouppertowctranstowlowertowupperungetcungetwcva_argva_copyva_endva_startvfprintfvfscanfvfwprintfvfwscanfvprintfvscanfvsprintfvsnprintfvsscanfvswprintfvswscanfvwprintfvwscanfwcrtombwcscatwcschrwcscmpwcscollwcscpywcscpywcsftimewcslenwcsncatwcsncmpwcsncpywcspbrkwcsptimewcsrchrwcsrtombswcsspnwcsstrwcstodwcstod32wcstod64wcstod128wcstofwcstokwcstolwcstoldwcstombswcstoulwcsxfrmwctobwctombwctranswctypewcwidthwmemchrwmemcmpwmemcpywmemmovewmemsetwprintfwscanfy0y1yn



Function Details : div

div_tdiv(int numer,int denom) ;

Return Type : div_t

A structure type returned by the `div` function, containing two members: `quot` (the quotient) and `rem` (the remainder) of an integer division.
Read about return values of div function .

1st Parameter Type : int

Integer type (typically 4 bytes, -2,147,483,648 to 2,147,483,647)

1st Parameter

The numerator (dividend) of the division

2nd Parameter Type : int

Integer type (typically 4 bytes, -2,147,483,648 to 2,147,483,647)

2nd Parameter

The denominator (divisor) of the division

Read more about parameters of div in parameters section
The divfunction in C language Divides two integers and returns both the quotient and remainder.
The div function computes the quotient and remainder of the division of the numerator numer by the denominator denom. This function is useful when you need both the quotient and remainder of an integer division operation. The result is returned in a structure of type div_t, which contains two int members: quot (the quotient) and rem (the remainder).
The divfunction takes 2 parameters:
  • int `numer`: The numerator (dividend) of the division
  • int `denom`: The denominator (divisor) of the division
Performs integer division of `numer` by `denom` and returns the result as a `div_t` structure, which contains both the quotient and the remainder.
The div function return value :
  • Returns a structure of type div_t that contains two int members: quot (the quotient) and rem (the remainder)

Output

This example demonstrates the basic usage of the `div` function. It divides 17 by 5 and shows both the quotient and remainder.