Mega Code Archive

 
Categories / C / Code Snippets
 

Quotient and remainder

#include <stdlib.h> #include <stdio.h> int main(void) { div_t j; j = div(13, 3); printf("Quotient and remainder: %d %d.\n", j.quot, j.rem); return 0; }