Back To C++ Classes
//program to demonstrate example of nested class (which means class within a class) , class student contains a class marks #include
#include
class marks { int physics; int maths; int chemistry; public: void getmarks() { cout<<"\nenter marks in physics "; cin>>physics; cout<<"\nenter marks in maths "; cin>>maths; cout<<"\nenter marks in chemistry "; cin>>chemistry; } void showmarks() { cout<<"\nmarks in physics are "<
>rollno; cout<<"\nenter name of student "; cin>>name; cout<<"\nenter class of student "; cin>>clas; m.getmarks(); } void showdata() { cout<<"\nrollno of student is "<