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