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
5 ★ | 1 Vote
You should read it
Maybe you are interested
Microsoft's official Windows 11 virtual machine is no longer available
How to build the world's longest sea crossing, located at a depth of 40m
Simple tips to help clothes last longer
What to do when Startup Repair takes too long?
List of Samsung smartphones with the longest battery life
What happens if you don't turn off your computer for a long time?