Wednesday, August 12, 2015

Scope Resolution Operator- Part (A)

// Thsi program is to demonstrate the first use of Scope Resolution Operator
#include<iostream.h>

int c=90;
void f2(int c)
{
c=900;
cout<<::c<<endl;
 cout<<c<<endl;
}
int f1()
{
c=1200;
}

int main()
{
f1();
int c=45;
cout<<::c<<endl;
{
int c=89;
cout<<c<<endl;;
f1();
cout<<::c<<endl;;
::c=900;
cout<<::c<<endl;;
 cout<<c<<endl;;
 }
cout<<::c<<endl;;
cout<<c<<endl;;
 {
 int c=77;
cout<<::c<<endl;;
 cout<<c<<endl;;
 }
 f2(c);
}
}

No comments:

Post a Comment