Function name : div
Header file : <stdlib.h>
Function prototype : div_t div(int x,int y);
Function : used to divide two integers
Parameter : int x is the dividend
int y is the divisor
Return value : Returns a structure containing the quotient and remainder
Supplement : typedef struct{
int quot;
int rem;
} div_t;
Program example : Use this function to find the quotient and remainder of the division of two integers 210 and 25, and output the result
#include<stdio.h>#include<stdlib.h>intmain(void){div_ta=div(210,25);printf(210div25=%dremainder%dn,a.quot,a.rem);// Output result return0;}
Running results
210div25=8remainder10