Advertisement
albela

Untitled

Apr 18th, 2021
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. //Q5.Write a simple program to perform default constructor.
  2. //Solution:-
  3.  
  4. #include <iostream>  
  5. using namespace std;  
  6. class Employee  
  7.  {  
  8.    public:  
  9.         Employee()    
  10.         {    
  11.             cout<<"Default Constructor Invoked"<<endl;    
  12.         }    
  13. };  
  14. int main(void)  
  15. {  
  16.     Employee e1; //creating an object of Employee  
  17.     Employee e2;  
  18.     return 0;  
  19. }  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement