- Get link
- X
- Other Apps
Output Shown Below The Code!
- #include<iostream>
- using namespace std;
- //Global Variables
- int x=10;
- main ()
- {
- //Local Variables
- int x=20;
- // printing the value of the local variables
- cout<<"The value of the local x: "<<x;
- /**using scope resolution operator (::)
- to access the global variables**/
- cout<<"\nThe value of the global variable x: "<<::x;
- return 0;
- }
Output:

Comments
Post a Comment