Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Write A program to perform member function in side ther clss as well as out side the class.
- #include<iostream.h>
- #include<conio.h>
- class opgohil
- {
- int a,b;
- public:
- void getdata()
- {
- cout<<"\nEnter Value 1 :";
- cin>>a;
- cout<<"\nEnter Value 2 :";
- cin>>b;
- } // declare member function inside the class
- void display(); // display member function out side the class
- };
- void opgohil :: display()
- {
- cout<<"\nValue 1 is : "<<a;
- cout<<"\nValue 2 is :"<<b;
- }
- void main()
- {
- clrscr();
- opgohil o;
- o.getdata();
- o.display();
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement