Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //default constractor
- #include<iostream.h>
- #include<conio.h>
- class opgohil
- {
- private:
- int a,b;
- public:
- opgohil()
- {
- a=4;
- b=4;
- }
- void display()
- {
- cout<<"A = "<<a<<endl; //endl is use for new line same like \n
- cout<<"B = "<<b;
- }
- };
- void main()
- {
- clrscr();
- opgohil o;
- o.display();
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement