fork download
  1. #include <stdio.h>
  2.  
  3. void cal(int x, int y, int *add, int *def);
  4.  
  5. int main(void) {
  6. int n1, n2, a, d;
  7. printf("n1 : "); scanf("%d", &n1);
  8. printf("n2 : "); scanf("%d", &n2);
  9. cal(n1, n2, &a, &d);
  10. printf("add:%d def:%d \n", a, d);
  11. return 0;
  12. }
  13. void cal(int x, int y, int *add, int *def){
  14. *add = x + y;
  15. *def = x - y;
  16. }
Success #stdin #stdout 0s 5296KB
stdin
Standard input is empty
stdout
n1 : n2 : add:-1801874564 def:-1801940092