C++ Aptitude Questions and Answers with PDF

Aug 31 • Resources • 60295 Views • 30 Comments on C++ Aptitude Questions and Answers with PDF

C++ is a programming language that is compiled, statically typed, multi-paradigm and free-form. This Language consists of both high-level and low-level language features. This language is used for hardware design and implemented on a wide variety of operating system platforms.

Here is a list of C++ aptitude questions with answers which will help you to improve your C++ programming skills that will be needed for various interviews like- campus interviews, placements, aptitude tests, entrance exams and other competitive exams.

C++ Aptitude Questions with Answers:

1. Which of the following statements is correct?

Logo of c++

Aptitude Question answers on C++

A. Pointer to derived class cannot be created.
B. Derived class pointer cannot point to base class.
C. Base class pointer cannot point to derived class.
D. Pointer to base class cannot be created.
Answer: Option B

2. Which of the following concept of oops allows compiler to insert arguments in a function call if it is not specified?

A. Default arguments
B. Call by reference
C. Call by value
D. Call by pointer

Answer: Option A

3. How many types of polymorphisms are supported by C++?

A. 3
B. 2
C. 1
D. 4

Answer: Option B

4. Which of the following correctly describes overloading of functions?

A. Ad-hoc polymorphism
B. Transient polymorphism
C. Virtual polymorphism
D. Pseudo polymorphism

Answer: Option A

5. How “Late binding” is implemented in C++?

A. Using C++ tables
B. Using Virtual tables
C. Using Indexed virtual tables
D. Using polymorphic tables

Answer: Option B

6. What happens when we try to compile the class definition in following code snippet?

   class Birds {};
             class Peacock : protected Birds {};

A. It will not compile because a class cannot be protectedly inherited from other class.
B. It will not compile because class body of Eagle is not defined.
C. It will not compile because class body of Birds is not defined.
D. It will compile successfully.

Answer: Option D

7. Which of the following also known as an instance of a class?

A. Friend Functions
B. Member Variables
C. Member Functions
D. Object

Answer: Option D

8. What does the class definitions in following code represent?

             class Bike
                        {
                                    Engine objEng;
                        };
                                    class Engine
                        {
                                    float CC;
                         };

A. kind of relationship
B. Inheritance
C. has a relationship
D. Both A and C

Answer: Option C

9. Which of the following means “The use of an object of one class in definition of another class”?

A. Encapsulation
B. Abstraction
C. Composition
D. Inheritance

Answer: Option C

10. Which of the following can be overloaded?

A. Object
B. Operators
C. Functions
D. Both B and C

Answer: Option D

11. Which of the following function prototype is perfectly acceptable?

A. int Function(int Tmp = Show());
B. float = Show(int, float) Function(Tmp);
C. float Function(int Tmp = Show(int, float));
D. Both A and C.

Answer: Option A

12. Which of the following function declaration is/are incorrect?

A. int Sum(int a = 0, int b, int c = 3);
B. int Sum(int a = 5, int b);
C. int Sum(int a, int b = 2, int c = 3);
D. All are correct.
E. Both A and B are incorrect.

Answer: Option E

13. Which of the following statement is correct?

A. The default value for an argument cannot be function call.
B.  C++ does not allow the redefinition of a default parameter.
C. Both A and B.
D. C++ allows the redefinition of a default parameter

Answer: Option B

14. Which of the following function / types of function cannot have default parameters?

A. Member function of class
B. Member function of structure
C. main()
D. Both B and C

Answer: Option C

15. What happens when a class with parameterized constructors and having no default constructor is used in a program and we create an object that needs a zero-argument constructor?

A. Runtime error.
B. Preprocessing error.
C. Compile-time error.
D. Runtime exception.

Answer: Option C

16. Copy constructor must receive its arguments by __________ .

A. only pass-by-reference
B. only pass-by-value
C. either pass-by-value or pass-by-reference
D. only pass by address

Answer: Option A

17. Which of the following gets called when an object goes out of scope?

A. constructor
B. virtual function
C. main
D. destructor

Answer: Option D

18. Which of the following are NOT provided by the compiler by default?

A. Zero-argument Constructor
B. Copy Destructor
C. Copy Constructor
D. Destructor

Answer: Option B

19. If the programmer does not explicitly provide a destructor, then which of the following creates an empty destructor?

A. Preprocessor
B. main() function
C. Linker
D. Compiler

Answer: Option D

20. Which of the following implicitly creates a default constructor when the programmer does not explicitly define at least one constructor for a class?

A. Preprocessor
B. Compiler
C. Loader
D. Linker

Answer: Option B

21. Which of the following never requires any arguments?

A. Default constructor
B. Friend function
C. Member function
D. const function

Answer: Option A

22. Which of the following statements are correct?

A. Destructor is always called explicitly.
B. Constructor is called either implicitly or explicitly, whereas destructor is always called implicitly.
C. Constructor is always called explicitly.
D. Constructor and destructor functions are not called at all as they are always inline.

Answer: Option B

23. To ensure that every object in the array receives a destructor call, always delete memory allocated as an array with operator __________ .

A. delete[] B. delete
C. destructor
D. kill[] E. free[]

Answer: Option A

24. What is output ?

int main(){

 int i=10;

 static int x=i;

 if(x==i)

 printf(“Equal”);

else if(x>i)

 printf(“Greater than”);

else

 printf(“Less than”);

return 0;

 }

A. Equal
B. Compiler error
C. Less than
D. Greater than

Answer: Option B

25. What will be output if you will compile and execute the following c code?

 #include

 int main(){

 int a=1,2;

 int b=(1,2);

 printf(“%d %d”,a,b);

 return 0;

 }

A. 1,1
B. 2,2
C. 2,1
D. 1,2

Answer: Option D

If you have any advice / feedback then just drop it in the below given comment section. Your feedback and advice is always welcome.

 Download PDF:

C++ Aptitude Questions Paper with Solution

Related Links:

Tell us Your Queries, Suggestions and Feedback

Your email address will not be published.

30 Responses to C++ Aptitude Questions and Answers with PDF

  1. ROSHINIDEVI says:

    Questions and answers

  2. Devulapally Prashanth says:

    I need to learn software

  3. manojkumar says:

    Bsc

  4. hariharan says:

    easily to annswer

  5. Md. Musleh Uddin says:

    Java programming

  6. Merlin Simoes says:

    c++ questions??

  7. Merlin Simoes says:

    c++ questions??

  8. Merlin Simoes says:

    c++ questions??

  9. Merlin Simoes says:

    c++ questions??

  10. Merlin Simoes says:

    c++ questions??

  11. Merlin Simoes says:
  12. porselvan says:

    C++ important notes

  13. Manikandan says:

    B.E-EEE

  14. prithivirajan says:
  15. ranjith says:

    mscit

  16. ranjith says:
  17. S.Brindha says:

    need frequently asked c++ placement question with answers

  18. dharani says:

    Bsc

  19. dharani says:
  20. Shweta says:

    C++

  21. keerthan says:

    How to write c++ program to find even or odd without using arithmetical operators

  22. shrinjit Dash says:

    b.tech engineering in electronics and instrumentation

  23. Frank says:

    I need a step by step guide on how to develop Aptitude test Program. This may include Requirement Analysis and design.

  24. Prajakta Wadekar says:

    i want to do php course… is there in placement is available in market for php language??

  25. Jude OSei says:

    my college inability to help us understand the fundamental in programming

  26. M Habib Ur Rehman says:

    I want to download a PDF file which have all c++ programmes
    so if you can help me then please tell me how to download the file.

  27. Priyanka Bhonde says:

    I have completed my B.E and now i want apply for softwa

  28. damini says:

    I m a final year student.placement is going to start from first weak of september in my college, not able to understand how to prepare for techinal aptitude round

    • Himanshu says:

      Just keep calm nd focus on ur areas which you r aware of firstly…nd than mostly recruiting companies ask you mostly the basic questions that can you go thoroughly just by reading only…
      Best of luck

  29. Ravesh Naik says:

    I will goto interview in next year… So i want tolearn c/c++ aptitude questions with solutions…

« »