Virtual base class C++ Program to print hollow square or rectangle star pattern

Develop a C++ program to print hollow square or rectangle star pattern by using the virtual base class in Object Oriented Programming.

Output

C++ program to print the hollow square or rectangle star pattern

Write a C++ program to print hollow square or rectangle star pattern by using for loop and multiple inheritance with virtual class in OOP.