There are three ways:
1. Use parameters and pass them by reference (& in front of them).
2. Use parameters and make them pointers.
3. Use Nutshell's idea and return a structure of three integers.
Here's an example of method 1.
Code:
#include <stdlib.h>
#include <stdio.h>
void calculate(int a, int b, int &sum, int &diff, int &prod, int &quo);
int main(void)
{
int a = 10;
int b = 5;
int sum, diff, prod, quot;
calculate(a,b,sum,diff,prod,quot);
printf("%d+%d=%d\n",a,b,sum);
printf("%d-%d=%d\n",a,b,diff);
printf("%d*%d=%d\n",a,b,prod);
printf("%d/%d=%d\n",a,b,quot);
return 0;
}
void calculate(int a, int b, int &sum, int &diff, int &prod, int &quo)
{
sum = a + b;
diff = a - b;
prod = a * b;
quo = a / b;
}