#include <iostream>
#include <string>
using namespace std;
class College{
public:
int Roll_no;
string Name, Department;
College(){
cout<<"This is MMMUT Gorakhpur"<<endl;
}
};
class student:public College{
public:
student(int R, string n, string d){
Roll_no = R;
Name = n;
Department = d;
}
void display(){
cout<<"Student Name is: "<<Name<<endl<<"Roll No: "<<Roll_no<<endl<<"Department: "<<Department<<endl;
}
};
int main()
{
student stu1(2021071042, "Vaibhav Yadav", "IT");
stu1.display();
student stu2(2021071060, "Ayush Verma", "IT");
stu2.display();
student stu3(2021071052, "Anurag Kumar Singh", "IT");
stu3.display();
// student stu;
return 0;
}
No comments:
Post a Comment