Menu

Custom Search

C++ lab Program

#include
#include
#include
struct student
{
private:
char name[30];
int roll;
float marks[3];
public:
void getdata();
void change();
void display();
};
void main()
{
clrscr();
student s;
s.getdata();
s.change();
s.display();
getch();


}
void student::change()
{ strcpy(name,"Rajesh");
roll=45;
marks[0]=87;
marks[1]=99;
marks[2]=89;

}
void student::display()
{
cout<>name;
cout<<"Enter roll:"; cin>>roll;
cout<<"Enter marks of three subjects:"<>marks[0]>>marks[1]>>marks[2];
}......

No comments:

Post a Comment