fork download
  1. #include <stdio.h>
  2.  
  3. /* Global variables (implicitly initialized to 0) */
  4. int a = 0, b = 0, c = 0, d = 0;
  5.  
  6. /* Function prototypes */
  7. void g1(int b, int c);
  8. void g2(int a, int c);
  9. int g3(int c, int a);
  10.  
  11. void g1(int b, int c)
  12. {
  13. /* prints globals and the parameters b, c in that order */
  14. printf("%d %d %d %d\n", a, b, c, d);
  15. }
  16.  
  17. void g2(int a, int c)
  18. {
  19. g1(a, c);
  20. }
  21.  
  22. int g3(int c, int a)
  23. {
  24. int b;
  25. b = 3;
  26. g1(a, b);
  27.  
  28. {
  29. int c;
  30. int d;
  31. d = 4;
  32. c = 8;
  33. g2(a, b);
  34. }
  35.  
  36. g1(a, b);
  37. return b;
  38. }
  39.  
  40. int main(void)
  41. {
  42. int a;
  43. int b;
  44. a = 4;
  45. b = 5;
  46. a = g3(b, c);
  47. g3(b, a); /* return value ignored */
  48.  
  49. return 0;
  50. }
  51.  
Success #stdin #stdout 0s 5288KB
stdin
Standard input is empty
stdout
0 0 3 0
0 0 3 0
0 0 3 0
0 3 3 0
0 3 3 0
0 3 3 0