The function ldiv () in C
The div_t div function (long int numer, long int denom) divides the numerator numer to denom.
The function ldiv () in C
The div_t div function (long int numer, long int denom) divides the numerator numer to denom .
The function ldiv () in C
Below is the declaration for ldiv () in C:
div_t div ( long int numer , long int denom )
Parameters
numer : numerator.
denom : denominator.
Returns the value
This function returns the value in an internal, two-part structure, with div_t it is: long quot; long rem;
For example
The following C program illustrates the usage of ldiv () in C:
#include #include int main () { ldiv_t output ; output = ldiv ( 100000L , 30000L ); printf ( "Phan thuong cua phep chia = %ldn" , output . quot ); printf ( "Phan du cua phep chia = %ldn" , output . rem ); return ( 0 ); } Compiling and running the above C program will result:
According to Tutorialspoint
Previous lesson: Labs () function in C
Next lesson: The function rand () in C
Discover more
the parameter in C the value of C the pointer in C the elements in CShare by
Samuel Daniel
Update 25 May 2019
You should read it
- Malloc () function in C
- Function abs () in C
- The function getenv () in C
- The function rand () in C
- The abort () function in C
- The Quiet Details That Make a Sports Betting Platform Feel Reliable
- Instructions on creating toy set images with ChatGPT AI
- How are AI agents changing the journalism industry?
- The function rand () in C
- The function srand () in C
- The function mblen () in C