fork download
  1. #include <stdio.h>
  2. void cal(int x,int y,int *sum,int *diff,int *mul,int *mod);
  3.  
  4. int main(void) {
  5. // your code goes here
  6. int x=2, y=5, s, d, mu, mo;
  7. printf("x : %d ",x);
  8. printf("y : %d\n",y);
  9. cal(x,y,&s,&d,&mu,&mo);
  10.  
  11. printf("*sum:%d *diff:%d *mul:%d *mod:%d",s,d,mu,mo);
  12. return 0;
  13. }
  14. void cal(int x,int y,int *sum,int *diff,int *mul,int *mod){
  15. *sum=x+y;
  16. *diff=x-y;
  17. if(*diff<0){
  18. *diff=-*diff;
  19. }
  20. *mul=x*y;
  21. *mod=x/y;
  22. }
  23.  
  24.  
Success #stdin #stdout 0s 5284KB
stdin
Standard input is empty
stdout
x : 2 y : 5
*sum:7 *diff:3 *mul:10 *mod:0