C++ Global Variable with Examples
Global variables are described at the top of a program, outside of all functions. The value of a global variable remains constant throughout the execution of the program. Every function that is declared in the program, can access the global variable. #include<iostream> using namespace std; //global variable int a = 5; void display() { cout<<a<<endl; …