Popular Articles

From the 8th century the Muslim invaders began to make forays into Hindustan and by the 12th century the entire North India and the throne at Delhi had
Riding a bike in the hills is a matter of great pleasure. It is also an adventure, to be relished long after it has past.  Riding a bike in the
Privacy is an important thing in every section. Same goes for mobile phones too. People always have something to hide from others on their mobile phone

Latest Articles

Privacy is an important thing in every section. Same goes for mobile phones too. People always have something to hide from others on their mobile phone
Subhas Chandra Bose is one of the towering figures of the freedom movement. The fact that he differed from Gandhi and Nehru is well known and documented,
From the 8th century the Muslim invaders began to make forays into Hindustan and by the 12th century the entire North India and the throne at Delhi had

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

  • No comments found