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,y,sum,diff,mul,mod;
  7. printf("x : \n"); scanf("%d", &x);
  8. printf("y : \n"); scanf("%d", &y);
  9.  
  10. cal(x,y,&sum,&diff,&mul,&mod);
  11.  
  12. printf("sum:%d diff:%d mul:%d mod:%d",sum,diff,mul,mod);
  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 5272KB
stdin
8
2
stdout
x : 
y : 
sum:10 diff:6 mul:16 mod:4