fork download
  1. #include <stdio.h>
  2.  
  3. int globalVar = 5;
  4.  
  5. void func() {
  6. int localVar = 20;
  7. printf("Local variable inside func: %d\n", localVar);
  8. printf("Global variable inside func: %d\n", globalVar);
  9. }
  10.  
  11. int main() {
  12. func();
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0s 5324KB
stdin
Standard input is empty
stdout
Local variable inside func: 20
Global variable inside func: 5