fork(1) 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. int x,y,a,b,c,d;
  6. printf("x : "); scanf("%d",&x);
  7. printf("y : "); scanf("%d",&y);
  8. cal(x,y,&a,&b,&c,&d);
  9. printf("sum:%d dihh:%d mul:%d mod:%d/n",a,b,c,d);
  10.  
  11. return 0;
  12. }
  13. void cal(int x,int y,int *sum,int *diff,int *mul,int *mod)
  14. {
  15. *sum= x+y;
  16. if(x>y){
  17. *diff= x-y;
  18. }
  19. *mul= x*y;
  20. *mod= x/y;
  21. }
Success #stdin #stdout 0s 5280KB
stdin
5
6
stdout
x : y : sum:11 dihh:0 mul:30 mod:0/n