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