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