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
Close-up of the birthing process of the venomous snake with the longest fangs in the world
Old Christmas Traditions That No Longer Exist
Astronomers discover strange 'comet' with tail up to 560,000km long
Shazam Celebrates 100 Billionth Song Recognized, Along With Other Impressive Records
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