Popular Articles

  I was a small boy when John Wayne died in 1979. But even at that age  I loved the films of John Wayne and watched them in cinema halls with
Role of Inner Strength in our Life The inner strength should be the most important part of every human being since no one can do a thing properly without
Life is not that easy Most of us cannot tolerate untidiness around us be it our home or office. In fact we hate our foolishness and we curse ourselves

Latest Articles

Life is not that easy Most of us cannot tolerate untidiness around us be it our home or office. In fact we hate our foolishness and we curse ourselves
Role of Inner Strength in our Life The inner strength should be the most important part of every human being since no one can do a thing properly without
  I was a small boy when John Wayne died in 1979. But even at that age  I loved the films of John Wayne and watched them in cinema halls with

q. WAP to implement the use of scope resolution operator

#include
#include
int number=100;
int main()
{clrscr();
coute block\n";
int number=555;
couter;
}
coutin";
cout"numberumber=";
getch();
return 0;
}



output of the program:
in main
inside block
number=555 ::number=555
back in main
number=234 ::number=234

Description about program:

in the above programe firstly we declared globally number to100. Then in the main fuction we firstly define that we are in main then define an integer type number =243 . then inside an another block we again define an integer type number=555. Then if we simply write cout number in side that block it show an output number=555. outside the block if we write cout

People in this conversation