DFS :: MULTIPLE

#include<iostream.h>
#include<conio.h>

class sem1
{
int s1,s2,t;
public:
calc1();
};
sem1::calc1()
{
cout<<“SEM 1 -\nenter the marks of sub1:”;
cin>>s1;
cout<<“enter the marks of sub2:”;
cin>>s2;

t=s1+s2;
return t;
}
class sem2
{
int s1,s2,t;
public:
calc2();
};

sem2::calc2()
{

cout<<“SEM 2: – \nenter the marks of sub1:”;
cin>>s1;
cout<<“enter the marks of sub2:”;
cin>>s2;

t=s1+s2;
return t;
}
class sport
{
int sp,t;
public :
sprt();
};

sport::sprt()
{
cout<<“enter the marks of sports:”;
cin>>sp;
return sp;
}

class result : public sem1, public sem2, public sport
{
int total;
public :
finalres();
};

result::finalres()
{
total=calc1()+calc2()+sprt();
cout<<“Result :”<<total;
}

void main()
{
result obj;
clrscr();

obj.finalres();

getch();
}

Share

About the Author

Akash Padhiyar

Visit Website

There are no comments yet, add one below.

Leave a Comment

Your email address will not be published. Required fields are marked *

*

Time limit is exhausted. Please reload CAPTCHA.