Logo 
Search:

C++ Programming FAQ

Submit Interview FAQ
Home » Interview FAQ » C++ ProgrammingRSS Feeds

Which statement(s) is true regarding the above code? - Select option

  Shared By: Varick Fischer    Date: Nov 02    Category: C++ Programming    Views: 815

Answer:

Options

Consider the following code segment:
class B : public A
{
int a;
public:
int b;
void a_inp();
void a_out();
}
class C : public A
{
private:
float x;
public:
double get_calc();
double put_calc();
}
Which of the following statement(s) is true regarding the above code?

Options

a) Class A is the parent class of both the classes B and C; and class B inherits get_calc() from class C
b) Class A is the parent class of both the classes B and C, which do not have any relationship between them
c) Two classes cannot be the child classes of the same base class
d) Class A is the parent class of both the classes B and C; and class C inherits a_out() from class B

Answer : b) Class A is the parent class of both the classes B and C, which do not have any relationship between them

Share: 
 



Your Comment
  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].


Tagged: