Programming Languages (C/C++ Programming)

1. By default, members of a C++ class are:
a. Private
b. Public
c. Protected
d. None of the above

2. Which of the following statements is true in C++?
a. A struct cannot have member functions.
b. A struct cannot have private members.
c. The default access modifier of struct is public.
d. None of the above.

3. C++ supports:
a. Multiple inheritance
b. Pointer to functions
c. Recursion
d. All of the above

4. Which of the following is not a C++ keyword?
a. Extern
b. Auto
c. Inherits
d. None of the above

5. Which of the following is not a bitwise operator?
a. &&
b. <<
c. ~
d. ^

6. In C++, the expression 5/2 is evaluated to:
a. 2.5
b. 2
c. 3
d. None of the above

7. In C++, the string literal “C++” occupies exactly ………. of memory.
a. 3 bytes
b. 4 bytes
c. 5 bytes
d. 6 bytes

8. In C++, generic functions are created using the keyword:
a. Generic
b. Template
c. Class
d. Type

9. The implicit argument passed to a member function of a c++ class is called:
a. “implicit” pointer
b. “sender” object
c. “this” pointer
d. “me” object

10. The default copy constructor performs:
a. Deep copy
b. Shallow copy
c. Hard copy
d. Soft copy

Answers
1 – A / 2 – C / 3 – D / 4 – C / 5 – A / 6 – B / 7 – B / 8 – B / 9 – C / 10 – B

Comments

Popular posts from this blog

Electrical Machines (D.C. Generators)

Material Science Quiz (Mechanical Properties of Metals)

Material Science Quiz (Failure)