CPP MCQ



PAGES: 1   2   3   4     6   7         CHECK ANSWERS ON THE BOTTOM


1. An entity representing some characteristics and behaviour is-
a) object
b) class
c) struct
d) none of the above

2. Which of the following is not the feature of OOPs?
a) Data Encapsulation
b) Inheritance
c) Polymorphism
d) None of the above
3. The wrapping up of data and functions into a single unit is
a) Data Abstraction
b) Data Encapsulation
c) Both (a) & (b)
d) None of the above

4. Which of the following feature supports reusability and extensibility of classes?
a) Inheritance
b) Overloading
c) Polymorphism
d) None of the above

5. Inheritance is ………..in nature.
a) Intransitive
b) Transitive
c) Both (a) & (b)
d) None of the above

6. ………… is the ability for a message or data to be processed in more than one form
a) Class
b) Abstraction
c) Polymorphism
d) None of the above

7. The smallest individual unit in a program is ………
a) Keyword
b) Identifier
c) Token
d) None of the above

8. Which of the following features of procedure oriented programming is false
a) Large programs are divided into small or units called functions.
b) Employs bottom-up approach in program design.
c) Most of the functions share global data.
d) None of the above.

9. Which of the following features of object oriented programming is false?
a) Data is hidden and is not available to external functions.
b) New data & functions can be added easily.
c) Objects may communicate with each other through functions.
d) Emphasis is on the procedure rather than data.

10. The following is the C++ style comment
a) //
b) /*..*/
c) —
d) None of the above

11. Which of the following statements is false?
a) Every C++ program must have a main().
b) In C++, white spaces and carriage returns are ignored by the compiler.
c) C++ statements terminate with semicolon.
d) Main() terminates with semicolon.

12. An identifier in C++
a) Must begin with a letter only
b) Is not differentiated by cases
c) Contains all characters as significant
d) None of the above

13. 010 is an example of
a) decimal constant
b) octal constant
c) hexadecimal constant
d) None of the above

14. A sequence of characters surrounded by double quotes is
a) Character literal
b) String literal
c) Both (a) & (b)
d) None of the above

15. The following data type specifies an empty set of values
a) Void
b) Int
c) Char
d) None of the above

CHECK ANSWERS

 

PAGES: 1   2   3   4     6   7