0% found this document useful (0 votes)
81 views3 pages

C++ OOP MCQ

C++ is an object-oriented programming language that supports both procedural and object-oriented programming. It allows code reuse through concepts like inheritance and polymorphism. Key features of C++ include use of data types like bool not in C, array declaration using square brackets, and compiling source code using a compiler.

Uploaded by

majhis145
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
81 views3 pages

C++ OOP MCQ

C++ is an object-oriented programming language that supports both procedural and object-oriented programming. It allows code reuse through concepts like inheritance and polymorphism. Key features of C++ include use of data types like bool not in C, array declaration using square brackets, and compiling source code using a compiler.

Uploaded by

majhis145
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

1. What is C++?

a) C++ is an object oriented programming language


b) C++ is a procedural programming language
c) C++ supports both procedural and object oriented programming language
d) C++ is a functional programming language

2. Which of the following is the correct syntax of including a user defined header
files in C++?
a) #include [userdefined]
b) #include “userdefined”
c) #include <userdefined.h>
d) #include <userdefined>

3. Which of the following is used for comments in C++?


a) /* comment */
b) // comment */
c) // comment
d) both // comment or /* comment */

4. Which of the following is a correct identifier in C++?


a) VAR_1234
b) $var_name
c) 7VARNAME
d) 7var_name

5. Which of the following approach is used by C++?


a) Left-right
b) Right-left
c) Bottom-up
d) Top-down

6. Which of the following is not a type of Constructor in C++?


a) Default constructor
b) Parameterized constructor
c) Copy constructor
d) Friend constructor

7. What happens if the following C++ statement is compiled and executed?

int *ptr = NULL;


delete ptr;

a) The program is not semantically correct


b) The program is compiled and executed successfully
c) The program gives a compile-time error
d) The program compiled successfully but throws an error during run-time

8. Which of the following type is provided by C++ but not C?


a) double
b) float
c) int
d) bool

9. Which of the following correctly declares an array in C++?


a) array{10};
b) array array[10];
c) int array;
d) int array[10];
10. Which of the following is used to terminate the function declaration in C++?
a) ;
b) ]
c) )
d) :

11. What is Inheritance in C++?


a) Deriving new classes from existing classes
b) Overloading of classes
c) Classes with same names
d) Wrapping of data into a single class

12. What is meant by a polymorphism in C++?


a) class having only single form
b) class having four forms
c) class having many forms
d) class having two forms

13. Which concept allows you to reuse the written code in C++?
a) Inheritance
b) Polymorphism
c) Abstraction
d) Encapsulation

14. Which of the following refers to characteristics of an array?

a) An array is a set of similar data items


b) An array is a set of distinct data items
c) An array can hold different types of datatypes
d) None of the above

15. If we stored 5 elements or data items in an array, what will be the index
number of the array's last data item?

a) 3
b) 5
c) 4
d) 88

16. Which one of the following given statements is correct about the increment
operator?

a) Increment operator(or ++ ) usually adds 2 to its operand


b) Decrement operator ++ subtracts 1 to its operand
c) Decrement operator ++ subtracts 3 to its operand
d) Increment operator (or ++ ) usually adds 1 to its operand

17. In C++, can a for loop statement contain another for loop statement?

a) No
b) Yes
c) Runtime error
d) None of the above

18. Which of the following is used to terminate the structure in C++?

a) ;
b) :
c) ;;
d) }

19. Inside a structure, the declared data members are known as____

a) Data
b) Object & data
c) Members
d) None of the above

20. Which of the following language translator is used in C++?

a) Assembler
b) Interpreter
c) Compiler
d) Both Interpreter and Compiler

21. C++ is case sensitive language?

a) True
b) False

22. The operator '%' is known as?

a) Division Operator
b) Modulus Operator
c) Percentage Operator
d) None of the above

23. Which of the following operator is a ternary operator?

a) +=
b) !=
c) ::
d) ?:

24. Which of the following operator is known as Scope Resolution Operator?

a) ::
b) ?:
c) ->
d) .

25. Can we use the string in the Switch statement for case selection?

a) True
b) False

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy