Write A Program Simple Scope Resolution Operator Example Program In C++


 Write A Program Simple Scope Resolution Operator Example Program In C++

#include<iostream>
#include<conio.h>
#include<stdio.h>

//Main Function

using namespace std;

int a = 100; //Global variable

int main ()
{
        // Local Variable Declaration
    int a = 200;
   
    cout << "Simple Scope Resolution Example Program In C++\n";
   
    // Print Global Varibale
    cout << ::a<< endl;
   
    // Print Local Varibale
    cout << a << endl;

        //Main Function return Statement
        return 0;
}

OUTPUT:-

Simple Scope Resolution Example Program In C++                                                                                
100                                                                                                                           
200 


Comments