What is Global variable and How to Defining Global Variables with Example



Global  variable and Defining Global Variables

Global variables are defined above main() in the following way:-
                short number,sum;
                int bignumber,bigsum;
                char letter;
 
                main()
                {
 
                }
It is also possible to pre-initialise global variables using the = operator for assignment.
For example:-
                float sum=0.0;
                int bigsum=0;
                char letter=`A';
 
                main()
                 {
 
                }

Labels: