Open Means Open Means

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

Login to post a comment

Show
  • Create an account
  • Forgot your username?
  • Forgot your password?

Related Articles

  • Using command line argument in Shell Script
  • Call C function from C++ program
  • String copy function in c++
  • Conditional Operator in C++
  • Increment and Decrement Operator in c++
  • Some basic codes of data structures
  • FUNCTIONS IN C++ PART-1
  • Introduction to C Language
  • Arrival of Digital Television System
  • Cultural Studies: Genesis of Cultural Studies, Expanding the scope of cultural studies
  • About Us
  • Faqs
  • Contact Us
  • Disclaimer
  • Terms & Conditions