Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

how to make select an item from existing items in c++

+1 vote
asked Apr 12, 2019 by sirin xelil (130 points)

1 Answer

0 votes
answered Apr 12, 2019 by vishvajeet
#include<iostream.h>

#include<conio.h>

class Student

{

protected:

int rollno;

int marks;

public:

void getdata()

{

cout<<"\nEnter roll no.:";

cin>>rollno;

cout<<"\nEnter marks:";

cin>>marks;

}

};

class detail:public Student

{

public:

void display()

{

cout<<"\nto number in all subject:"<<marks;

cout<<"\nroll no.:"<<rollno;

}

};

void main()

{

details ob1;

ob1.getdata();

ob1.display();

getch();

}
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...