fork download
  1. #include <stdio.h>
  2.  
  3. void cal(int x, int y, int *sum, int *diff, int *mul, int *mod);
  4.  
  5. int main(void) {
  6. int x=2, y=3, sum, diff, mul, mod;
  7.  
  8. cal(x, y, &sum, &diff, &mul, &mod);
  9.  
  10. printf("x, y の和: %d, 差: %d, 積: %d, 商: %d\n", sum, diff, mul, mod);
  11.  
  12. return 0;
  13. }
  14.  
  15. void cal(int x, int y, int *sum, int *diff, int *mul, int *mod) {
  16. *sum = x + y;
  17. *diff = x - y;
  18. *mul = x * y;
  19. *mod = x / y;
  20. }
Success #stdin #stdout 0s 5288KB
stdin
Standard input is empty
stdout
x, y の和: 5, 差: -1, 積: 6, 商: 0