fork download
  1. #include <stdio.h>
  2.  
  3. int x=0;
  4. int y=1;
  5.  
  6. void add_k_to_xy(int k, int z)
  7. {
  8. int y=0;
  9. x = x + k;
  10. y = y + k;
  11. z = z + k;
  12. }
  13.  
  14. int main()
  15. {
  16. int z=0;
  17. x = x + 4;
  18. y = y + 4;
  19. z = z + 4;
  20.  
  21. add_k_to_xy(3,2);
  22. printf("x:%d y:%d z:%d\n", x,y,z);
  23.  
  24. }
Success #stdin #stdout 0.01s 5300KB
stdin
Standard input is empty
stdout
x:7 y:5 z:4