C++ Aptitude Question Paper With Solution

Share Embed Donate


Short Description

Download C++ Aptitude Question Paper With Solution...

Description

C++ Aptitude Questions Paper Paper With Solutions 1. Where is the derived class is derived from? a) derived b) base c) both a & b d) None of the mentioned Answer:b

2. What is the output of this program? 1.

#include

2.

using namespace namespace std  std; ;

3.

class X class  X

4.

{

5.

int m int  m; ;

6.

public: public :

7.

X() : m  m( (10 10) )

8.

{

9.

}

10.

X(int int mm  mm) ): m  m( (mm mm) )

11.

{

12.

}

13.

int getm int  getm() ()

14.

{

15. 16.

return m return  m; ; }

17.

};

18.

class Y class  Y : public public X  X

19.

{

20.

int n int  n; ;

21.

public: public :

22.

Y(int int nn  nn) ) : n  n( (nn nn) ) {}

23.

int getn int  getn() () { return return n  n; ; }

24.

};

25.

int main int  main() ()

26.

{

27.

Y yobj( yobj( 100 );

28.

cout
View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF