Scope of Variables

A scope in any programming is a region of the program where a defined variable can have its existence and beyond that variable it cannot be accessed. There are three places where variables can be declared in C programming language −

  • Inside a function or a block which is called local variables.
  • Outside of all functions which is called global variables.
  • In the definition of function parameters which are called formalparameters.