| Description
This shows integer division
using the div function . The div function
returns a structure called div_t ,
this contains the quotient and the
remainder .
Code
#include <stdio.h>
#include <stdlib.h>
int main()
{
div_t result;
result = div(77,5);
printf("77 divided by 5 is %d
with a remainder of %d.\n", result.quot,result.rem);
return 0;
}
Information
tested using LCC Win
32
|