#include <bits/stdc++.h> using namespace std; class base { public: int x; void show() { cout<<x<<"\n"; } }; class derived:public base //Inheritance { public: int y; void display() { cout<<x<<" "<<y<<"\n"; } }; int main() { base b; b.x=4; b.show(); derived d; d.x=10; d.y=5; d.show(); d.display(); return 0; }