#include<iostream.h>
#include<conio.h>
class student
{
protected:
char* name;
int rollnumber;
public:
student()
{
name="MaHi";
rollnumber=1025;
}
void setnumber(int no)
{
rollnumber=no;
}
int getrollnumber()
{
return rollnumber;
}
void show1()
{
cout<<"\n Roll Number= "<<rollnumber;
cout<<"\n Name= "<<name;
}
};
class anualtest:public student
{
protected:
int mark1,mark2;
public:
anualtest(int m1,int m2)
{
mark1=m1;
mark2=m2;
}
int getmarks()
{
return mark1;
return mark2;
}
void show()
{
cout<<"\n Mark1= "<<mark1;
cout<<"\n mark2= "<<mark2;
}
};
void main()
{
clrscr();
anualtest a1(90,90);
a1.show1();
a1.show();
getch();
}
#include<conio.h>
class student
{
protected:
char* name;
int rollnumber;
public:
student()
{
name="MaHi";
rollnumber=1025;
}
void setnumber(int no)
{
rollnumber=no;
}
int getrollnumber()
{
return rollnumber;
}
void show1()
{
cout<<"\n Roll Number= "<<rollnumber;
cout<<"\n Name= "<<name;
}
};
class anualtest:public student
{
protected:
int mark1,mark2;
public:
anualtest(int m1,int m2)
{
mark1=m1;
mark2=m2;
}
int getmarks()
{
return mark1;
return mark2;
}
void show()
{
cout<<"\n Mark1= "<<mark1;
cout<<"\n mark2= "<<mark2;
}
};
void main()
{
clrscr();
anualtest a1(90,90);
a1.show1();
a1.show();
getch();
}
No comments:
Post a Comment