What is the scope of a global variable in a C program?

  • Accessible throughout the entire program
  • Limited to the file where it's declared
  • Local to the function it's defined in
  • Only within the main() function
In C, global variables have a scope that spans the entire program, meaning they can be accessed from any part of the code.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *