Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
using namespace std;
3.
class student
4.
{
5.
public:
6.
int rno , m1 , m2 ;
7.
protected:
8.
void get()
9.
{
10.
rno = 15, m1 = 10, m2 = 10;
11.
}
12.
};
13.
class sports
14.
{
15.
public:
16.
int sm;
17.
void getsm()
18.
{
19.
sm = 10;
20.
}
21.
};
22.
class statement : public student, public sports
23.
{
24.
int tot, avg;
25.
public:
26.
void display()
27.
{
28.
tot = (m1 + m2 + sm);
29.
avg = tot / 3;
30.
cout
Options:
A .  3010
B .  1010
C .  2100
D .  Error
Answer: Option A

None.



Was this answer helpful ?
Next Question

Submit Solution

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

Latest Videos

Latest Test Papers