© 2014 Firstsoft Technologies (P) Limited. login
Hi 'Guest'
Home SiteMap Contact Us Disclaimer
enggedu
Quick Links
Easy Studies

Home Lab Exercise Object Oriented Programming Lab Exercise ProgramsCPP Program To Implement Encapsulation▼


CPP Program To Implement Encapsulation

Alogarithm steps:

  1. Start the program
  2. Create the class and declare the data members
  3. Pass the value for the variables through the function
  4. Create the object for the class and call the function with arguments
  5. Compile and execute the program

CPP Program To Implement Encapsulation

#include class myclass { int a, b; public: void init(int i, int j); { a = i; b = j; } void show(); { cout<<”a=”<

SAMPLE INPUT AND OUTPUT:

 a=10
b=20

 
SLogix Student Projects

⇓Student Projects⇓
⇑Student Projects⇑
bottom