fork download
  1. #include <stdio.h>
  2.  
  3. void cal (int x,int y,int *add,int *sub);
  4.  
  5. int main(void)
  6. {
  7. int n1,n2,a,b;
  8. printf("n1 : ");scanf("%d\n",&n1);
  9.  
  10. printf("n2 : ");scanf("%d\n",&n2);
  11.  
  12. cal(n1,n2,&a,&b);
  13. printf("add:%d sub:%d\n",a,b);
  14.  
  15. return 0;
  16. }
  17.  
  18. void cal (int x,int y,int *add,int *sub){
  19.  
  20. *add=x+y;
  21. *sub=x-y;
  22. }
  23.  
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
n1 : n2 : add:-659818945 sub:-659884479