Popular Articles

The Anglo Sikh wars (1846-49) were the most ferocious battles faced by the British in India. These battles deeply affected the British psyche, with the
I have been wanting to write about the military heroes of the 20th century from India. We have so many great soldiers and airmen who are not remembered
Backwaters are unique tourist attractions of Kerala. Cruising along the marvelous Kerala backwaters on a traditional house boat is one of the best ways

Latest Articles

Backwaters are unique tourist attractions of Kerala. Cruising along the marvelous Kerala backwaters on a traditional house boat is one of the best ways
I have been wanting to write about the military heroes of the 20th century from India. We have so many great soldiers and airmen who are not remembered
The Anglo Sikh wars (1846-49) were the most ferocious battles faced by the British in India. These battles deeply affected the British psyche, with the

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