Polymorphism in C++

Source code :

#include<iostream>

class base
    {
       public:
        void show()  
        { 
        std::cout<<"aro "; 
        }
    };
    class derv_1
    {
       public:
        void show()  
        { 
        std::cout<<"pro"; 
        }
    };
    class derv_2
    {
       public:
        void show() 
        { 
        std::cout<<"gram"; 
        }
    };
  int main()
    {
      
       base baseobj;
       baseobj.show();
       derv_1 derv_1obj;
       derv_2 derv_2obj;
       derv_1obj.show();
       derv_2obj.show();
       
          }

Output :

0

Output :


                

Comments :