-->

Facebook

Jasper Roberts - Blog

Wednesday, March 11, 2015

Write a C++ Program to demonstrate scope resolution operator.

#include<iostream.h>
//using namespace std;
int m=10;
int main()
{
int m=20;
{
int k=m;
int m=30;
cout<<"\nWe are in iner block"<<"\n";
cout<<"\nk = "<<k;
cout<<"\nm = "<<::m;
}
cout<<"We are in outer block"<<"\n";
cout<<"\nm = "<<m;
return 0;
}

RELATED TOPICS
Write a C++ Program to convert temperature into Fahrenheit.
Write a C++ Program to demonstrate class.

No comments:

Post a Comment