Upcasting is the process of creating the derived class's pointer or reference from the base class's pointer or reference. It…