Advertisement
TechOPGOHIL

Untitled

Dec 3rd, 2023
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. //default constractor
  2. #include<iostream.h>
  3. #include<conio.h>
  4. class opgohil
  5. {
  6.     private:
  7.     int a,b;
  8.     public:
  9.     opgohil()
  10.     {
  11.         a=4;
  12.         b=4;
  13.     }
  14.     void display()
  15.     {
  16.         cout<<"A = "<<a<<endl; //endl is use for new line same like \n
  17.         cout<<"B = "<<b;
  18.     }
  19. };
  20. void main()
  21. {
  22.     clrscr();
  23.     opgohil o;
  24.     o.display();
  25.     getch();
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement