/* * Program to demonstrate defining and using a function with pointer * arguments. */ #include void divide(int a, int b, int *quot, int *rem) { *quot = a / b; *rem = a % b; } int main(void) { int x, y; printf("enter x, y\n"); if (scanf("%d %d", &x, &y) != 2) { printf("not numbers\n"); return 1; } int q, r; divide(x, y, &q, &r); printf("for x = %d, y = %d: quotient %d, remainder %d\n", x, y, q, r); return 0; }