C++ program to override a function YASH PAL, 31 July 202422 August 2024 In this post, we will write a C++ program to override a function. C++ program to override a function. #include<iostream> #include<conio.h> class base { public: void fun() { std::cout<<"World is great"; std::cout<<"nIt is a base class"; } }; class derived : public base { public: void fun() { std::cout<<"nHigher Education"<<std::endl; std::cout<<"It is a derived class"; } }; int main() { system("cls"); derived d; d.fun(); getch(); return 0; } Output Higher Education It is a derived class coding problems cpp