This is the source code from the C Programming Tutorial. In this source code, you are going to learn about Scope Rules in C Programming language.
There are two types of variable in C Programming
- Local Variable
- Global Variable
The variables which are declared inside the functions are called local variable.
Variables which are declared outside of all functions are known as global variable or external variable. Global variables are accessible by any functions.
int x ; // x -> global variable
int a; // a is local variable of main() function
printf("Global variable = %d \n", x);