#include
#include
class student
{
private:
char name[20];
int rno,m1,m2,m3,sum,avg;
public:
void accept()
{
cout<<"\n";
cout<<"Enter student Name,number,marks in three subjects"<<"\n";
cin>>name>>rno>>m1>>m2>>m3;
}
void compute()
{
sum=m1+m2+m3;
avg=sum/3;
}
void display()
{
cout<
};
void main()
{
clrscr();
student s1,s2;
s1.accept();
s2.accept();
cout<<"\n"<<"STUDENTS DATA"<<"\n";
s1.compute();
s2.compute();
cout<<"\nNAME REG_NO M1 M2 M3 TOTAL AVG\n";
s1.display();
cout<
getch();
}
OUTPUT:
Enter student Name,number,marks in three subjects
ravi
567
90
89
90
Enter student Name,number,marks in three subjects
raju
543
78
90
78
STUDENTS DATA
NAME REG_NO M1 M2 M3 TOTAL AVG
ravi 567 90 89 90 269 89
raju 543 78 90 78 246 82
No comments:
Post a Comment