Menu

Custom Search

C++ lab Program

......................
#include
#include
class student
{

char name[30];
int roll;
float marks[3];

void getdata();
void display();
};
void main()
{
clrscr();
student s;
public: s.getdata();
s.display();
getch();


}
void student::getdata()
{
cout<<"Enter name:"; cin>>name;
cout<<"Enter roll:"; cin>>roll;
cout<<"Enter marks of three subjects:"; cin>>marks[0]>>marks[1]>>marks[2];
}
void student::display()
{
cout<<"Name:"< cout<<"Roll:"< cout<<"Mark 1:"<
float x=(marks[0]+marks[1]+marks[2])/3;
cout<<"Average mark:"< }.................

No comments:

Post a Comment