fork download
  1. #include <stdio.h>
  2. void cal (int x,int y, int*sum,int*diff,int*mul,int*mod);
  3. int main(void) {
  4.  
  5. int a,b,c,d,x,y;
  6. printf("x:"); scanf("%d",&x);
  7. printf("y:"); scanf("%d",&y);
  8. cal (x,y,&a, &b,&c,&d);
  9. printf("sum:%d diff:%d mul:%d mod:%d",a,b,c,d);
  10. return 0;
  11. }
  12.  
  13. void cal (int x,int y, int*sum,int*diff,int*mul,int*mod){
  14.  
  15. *sum=x+y;
  16. *diff=x>y?x-y:y-x;
  17. *mul=x*y;
  18. *mod=x/y;
  19.  
  20. }
Success #stdin #stdout 0s 5280KB
stdin
10
4
stdout
x:y:sum:14 diff:6 mul:40 mod:2